Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: rabbottI've got an XML data source where the fields will vary somewhat because the source does not return fields with null values. For example:
<QueryResult>
<records>
<record1>5005000000DqMsEAAV</record1>
<record2>00001719</record2>
<record3>0035000000vsM6xAAE</record3>
</records>
<records>
<record1>5005000000EANAZAA5</record1>
<record2>00001769</record2>
<record4>0035000000vsM6xAAE</record4>
</records>
<records>
<record1>5005000000FO1IaAAL</record1>
<record2>CS-3753</record2>
<record5>0035000000lcyszAAA</record5>
</records>
</QueryResult>
Notice that the third field name in each record varies. When I run this through the Convert Tabular XML, the results look like this:
record1 record2 record3
5005000000DqMsEAAV 00001719 0035000000vsM6xAAE
5005000000EANAZAA5 00001769 NULL
5005000000FO1IaAAL CS-3753 NULL
The Convert Tabular XML node only recognizes the field names from the first record and any variation thereafter is ignored. I've played with numerous different settings based on the examples in the help file but nothing seems to apply to this particular scenario. For the above example I used the following settings:
prop:FieldNameFunction=local-name()
prop:FieldNameXPath={{^RecordXPath^}}/*
prop:FieldValueFunction=string()
prop:FieldValueXPath={{^FieldNameXPath^}}
prop:NullValueBehavior=Error
prop:RecordXPath=/QueryResult/records
Attached is the example graph. What I'd like is for the node to append all new fields into the result set, similar to how a Cat node works in Union mode, which would be to output all of the fields across the records, filling in nulls for fields not present in a given record.
Attachments:
ConvertTabXML2.brg