Reading XML
Designer can read and parse XML through either the
Input Data Tool or the XML Parse Tool. These examples focus on the Input Data tool configuration options.
All descriptions reference the example below.
XML example
<items>
<item id="01" type="Donut">
<name>Cake</name>
<ppu>0.60</ppu>
<batters>
<batter id="10">Regular</batter>
<batter id="11">Chocolate</batter>
<batter id="12">Blueberry</batter>
<batter id="13">Devil's Food</batter>
</batters>
<topping>
<topping id="100">None</topping>
<topping id="101">Glazed</topping>
<topping id="102">Sugar</topping>
<topping id="103">Powdered Sugar</topping>
<topping id="104">Chocolate</topping>
<topping id="105">Chocolate with Sprinkles</topping>
<topping id="106">Maple</topping>
</topping>
</item>
<item id="02" type="Donut">
<name>Raised</name>
<ppu>0.65</ppu>
<batters>
<batter id="10">Regular</batter>
</batters>
<topping>
<topping id="100">None</topping>
<topping id="101">Glazed</topping>
<topping id="102">Sugar</topping>
<topping id="104">Chocolate</topping>
<topping id="106">Maple</topping>
</topping>
</item>
<item id="03" type="Donut">
<name>Buttermilk</name>
<ppu>0.50</ppu>
<batters>
<batter id="10">Regular</batter>
<batter id="11">Chocolate</batter>
</batters>
</item>
</items>
Default settings
The Input Data tool uses these default XML settings:
These settings applied to the example XML input generate the following results:
These results:
- do not contain the root element.
- contain the child elements of the root element.
- contain the grandchild elements of the root element.
- do not contain the child elements of a specified element.
- do not contain tag formatting.
Child element name
Specifying an XML Child Element Name causes Alteryx to read the file from the element.
These settings applied to the example XML input generate the following results:
These results:
- do not contain the root element.
- do not contain the child elements of the root element.
- do not contain the grandchild elements of the root element.
- contain the child elements of a specified element.
- do not contain tag formatting.
The remaining sections detail the impact on returned results when changing configuration selections from the default options.
Return Root Element
Select Return Root Element to return the parent element that encloses all other represented elements.
These settings applied to the example XML input generate the following results:
These results:
- contain the root element.
- contain the child elements of the root element.
- do not contain the grandchild elements of the root element.
- do not contain the child elements of a specified element.
- do not contain tag formatting.
Child element name
Specifying an XML Child Element Name does not change the results. Alteryx prioritizes reading the root element.
Return Child Values
Deselect Return Child Values to return only the child values of the root element.
These settings applied to the example XML input generate the following results:
These results:
- do not contain the root element.
- contain the child elements of the root element.
- do not contain the grandchild elements of the root element.
- do not contain the child elements of a specified element.
- do not contain tag formatting.
Child element name
Specifying an XML Child Element Name causes Alteryx to read the file from the specified element.
These settings applied to the example XML input generate the following results:
These results:
- do not contain the root element.
- do not contain the child elements of the root element.
- do not contain the grandchild elements of the root element.
- do not contain the child elements of a specified element.
- do not contain tag formatting.
Return Outer XML
Select Return Outer XML to create additional columns containing the tag format of the child elements.
These settings applied to the example XML input generate the following results:
These results:
- do not contain the root element.
- do not contain the child elements of the root element.
- do not contain the grandchild elements of the root element.
- do not contain the child elements of a specified element.
- contain tag formatting.
Child element name
Specifying an XML Child Element Name causes Alteryx to read the file from the specified element.
These settings applied to the example XML input generate the following results:
These results:
- do not contain the root element.
- do not contain the child elements of the root element.
- do not contain the grandchild elements of the root element.
- contain the child elements of a specified element.
- contain tag formatting.