XML Parse Tool
Docs are available before the release of Designer Cloud so you can get a sneak peek. This content might change between now and the official release.
One Tool Example
XML Parse has a One Tool Example. Visit Sample Workflows to learn how to access this and many other examples directly in Alteryx Designer Cloud.
Use XML Parse to parse Extensible Markup Language (XML) into individual fields. Visit Reading XML for more information on how Alteryx reads and parses XML.
If the XML contains namespaces such as
w:document, the namespace is stripped from the output and
w:document is returned.
Configure the Tool
- Select Column with XML to Parse and choose string columns from the input.
- Select XML Element to Parse:
- Auto Detect Child: Parse out the element that is a child to the element in the input data—an alternative to specifying which element of the XML to parse. If an element occurs the highest number of times under a single parent node, this is the element that is chosen to parse.
- Specify Child: Enter the name of the child element to be parsed out. The XML element is case sensitive.
- Select other options:
- Output Child Values: Return the 1st set of child values.
- Output Outer XML: Return the outer XML tags. An additional column for each parsed column is created with the suffix
_OuterXML, and the tags are included around the values in the data table.
- Ignore XML Errors and Continue Processing Data: Ignore any errors that are produced by the XML and continues parsing.
How Auto-detect Child Works
If an element occurs the highest number of times under a single parent node, this is the chosen element. If no element occurs more than once, then the default behavior is to select the 1st child of the root.
In this example, the
record element is auto-detected because it occurs 3 times under the 1 parent.
firstchild elements each appear once.
field3 elements appear 3 times each, but not under a single parent node (they each occur once per parent
<root> <firstchild> <record><field1/><field2/><field3/></record> <record><field1/><field2/><field3/></record> <record><field1/><field2/><field3/></record> </firstchild> </root>
Auto-detect Child only takes the 1st row of input into account versus all rows of input. The messages tab on the output of the XML Parse tool should show a message indicating which element was auto detected as the default.