Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions kpi/views/v2/paired_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,11 @@ def external(self, request, paired_data_uid, **kwargs):
parsed_submissions = []

for submission in submissions:
# Use `rename_root_node_to='data'` to rename the root node of each
# submission to `data` so that form authors do not have to rewrite
# Use `rename_root_node_to='item'` to rename the root node of each
# submission to `item` so that form authors do not have to rewrite
# their `xml-external` formulas any time the asset UID changes,
# and most importantly to integrate well with all pyxform xpath
# evaluations that are always prefixed by root/item
# e.g. when cloning a form or creating a project from a template.
# Set `use_xpath=True` because `paired_data.fields` uses full group
# hierarchies, not just question names.
Expand All @@ -265,7 +267,7 @@ def external(self, request, paired_data_uid, **kwargs):
submission,
paired_data.allowed_fields,
use_xpath=True,
rename_root_node_to='data',
rename_root_node_to='item',
)
)

Expand Down