[en] Reading XML
[en] Alteryx 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.
[en] All descriptions reference the example below.
[en] XML Example
<items> <item id="01" type="Donut"> <name>Cake</name> <ppu>0.60</ppu> <batters> <batter id="10">正则</batter> <batter id="11">巧克力</batter> <batter id="12">蓝莓</batter> <batter id="13">恶魔蛋糕</batter> </batters> <topping> <topping id="100">none</topping> <topping id="101">糖釉</topping> <topping id="102">糖</topping> <topping id="103">糖粉</topping> <topping id="104">巧克力</topping> <topping id="105">巧克力糖屑</topping> <topping id="106">枫糖</topping> </topping> </item> <item id="02" type="Donut"> <name>提糖</name> <ppu>0.65</ppu> <batters> <batter id="10">正则</batter> </batters> <topping> <topping id="100">none</topping> <topping id="101">糖釉</topping> <topping id="102">糖</topping> <topping id="104">巧克力</topping> <topping id="106">枫糖</topping> </topping> </item> <item id="03" type="Donut"> <name>酪乳</name> <ppu>0.50</ppu> <batters> <batter id="10">正则</batter> <batter id="11">巧克力</batter> </batters> </item> </items>
[en] Default Settings
[en] The Input Data tool uses these default XML settings:
[en] Configuration Option | [en] Setting |
---|---|
[en] Return Root Element | [en] Deselected |
[en] XML Child Element Name | [en] Unspecified |
[en] Return Child Values | [en] Selected |
[en] Return Outer XML | [en] Deselected |
[en] These settings, when applied to the example XML input, generate these results:
[en] Don't contain the root element.
[en] Contain the child elements of the root element.
[en] Contain the grandchild elements of the root element.
[en] Don't contain the child elements of a specified element.
[en] Don't contain tag formatting.
[en] Child Element Name
[en] Specifying an XML Child Element Name causes Alteryx to read the file from the element.
[en] Configuration Option | [en] Setting |
---|---|
[en] Return Root Element | [en] Deselected |
[en] XML Child Element Name | [en] "topping" |
[en] Return Child Values | [en] Selected |
[en] Return Outer XML | [en] Deselected |
[en] These settings, when applied to the example XML input, generate these results:
[en] topping | [en] topping_1 | [en] topping_1_id | [en] topping_2 | [en] topping_2_id | [en] topping_3 | [en] topping_3_id |
---|---|---|---|---|---|---|
[en] None | 100 | [en] Glazed | 101 | [en] Sugar | 102 | |
[en] None | 100 | [en] Glazed | 101 | [en] Sugar | 102 | |
[en] Chocolate | 104 | [en] Maple | 106 | |||
[en] Glazed | 101 | [en] Sugar | 102 | |||
[en] Glazed | 101 | [en] Powdered Sugar | 103 | [en] Chocolate | 104 |
[en] These results...
[en] Don't contain the root element.
[en] Don't contain the child elements of the root element.
[en] Don't contain the grandchild elements of the root element.
[en] Contain the child elements of a specified element.
[en] Don't contain tag formatting.
[en] The remaining sections detail the impact on returned results when changing configuration selections from the default options.
[en] Return Root Element
[en] Select Return Root Element to return the parent element that encloses all other represented elements.
[en] Configuration Option | [en] Setting |
---|---|
[en] Return Root Element | [en] Selected |
[en] XML Child Element Name | [en] Unspecified |
[en] Return Child Values | [en] Selected |
[en] Return Outer XML | [en] Deselected |
[en] These settings, when applied to the example XML input, generate these results:
[en] items | [en] item | [en] item_id | [en] item_type | [en] item_2 | [en] item_2_id | [en] imem_2_type | [en] item_3 | [en] item_3_id | [en] item_3_type |
---|---|---|---|---|---|---|---|---|---|
01 | [en] Donut | 02 | [en] Donut | 03 | [en] Donut |
[en] These results...
[en] Contain the root element.
[en] Contain the child elements of the root element.
[en] Don't contain the grandchild elements of the root element.
[en] Don't contain the child elements of a specified element.
[en] Don't contain tag formatting.
[en] Child Element Name
[en] Specifying an XML Child Element Name does not change the results. Alteryx prioritizes reading the root element.
[en] Return Child Values
[en] Deselect Return Child Values to return only the child values of the root element.
[en] Configuration Option | [en] Setting |
---|---|
[en] Return Root Element | [en] Deselected |
[en] XML Child Element Name | [en] Unspecified |
[en] Return Child Values | [en] Deselected |
[en] Return Outer XML | [en] Deselected |
[en] These settings, when applied to the example XML input, generate these results:
[en] item | [en] id | [en] type |
---|---|---|
01 | [en] Donut | |
02 | [en] Donut | |
03 | [en] Donut |
[en] These results...
[en] Don't contain the root element.
[en] Contain the child elements of the root element.
[en] Don't contain the grandchild elements of the root element.
[en] Don't contain the child elements of a specified element.
[en] Don't contain tag formatting.
[en] Child Element Name
[en] Specifying an XML Child Element Name causes Alteryx to read the file from the specified element.
[en] Configuration Option | [en] Setting |
---|---|
[en] Return Root Element | [en] Deselected |
[en] XML Child Element Name | [en] "topping" |
[en] Return Child Values | [en] Deselected |
[en] Return Outer XML | [en] Deselected |
[en] These results...
[en] Don't contain the root element.
[en] Don't contain the child elements of the root element.
[en] Don't contain the grandchild elements of the root element.
[en] Don't contain the child elements of a specified element.
[en] Don't contain tag formatting.
[en] Return Outer XML
[en] Select Return Outer XML to create additional columns containing the tag format of the child elements.
[en] Configuration Option | [en] Setting |
---|---|
[en] Return Root Element | [en] Deselected |
[en] XML Child Element Name | [en] Unspecified |
[en] Return Child Values | [en] Selected |
[en] Return Outer XML | [en] Selected |
[en] These settings, when applied to the example XML input, generate these results:
[en] item | [en] id | [en] type | [en] name | [en] name_OuterXML | [en] ppu | [en] ppu_OuterXML | [en] batters | [en] batters_OuterXML |
---|---|---|---|---|---|---|---|---|
01 | [en] Donut | [en] Cake | [en] <name>Cake</name> | 0.60 | [en] <ppu>0.60</ppu> | [en] <batters> | ||
02 | [en] Donut | [en] Raised | [en] <nane>Raised</name> | 0.65 | [en] <ppu>0.65</ppu> | [en] <batters> | ||
03 | [en] Donut | [en] Buttermilk | [en] <name>Buttermilk</name> | 0.50 | [en] <ppu>0.50</ppu> | [en] <batters> |
[en] These results...
[en] Don't contain the root element.
[en] Don't contain the child elements of the root element.
[en] Don't contain the grandchild elements of the root element.
[en] Don't contain the child elements of a specified element.
[en] Contain tag formatting.
[en] Child Element Name
[en] Specifying an XML Child Element Name causes Alteryx to read the file from the specified element.
[en] Configuration Option | [en] Setting |
---|---|
[en] Return Root Element | [en] Deselected |
[en] XML Child Element Name | [en] "topping" |
[en] Return Child Values | [en] Selected |
[en] Return Outer XML | [en] Selected |
[en] These settings, when applied to the example XML input, generate these results:
[en] topping | [en] topping_1 | [en] topping_1_id | [en] topping_1_OuterXML | [en] topping_2 | [en] topping_2_id |
---|---|---|---|---|---|
[en] None | 100 | [en] <topping id="100">None</topping> | [en] Glazed | 101 | |
[en] None | 100 | [en] <topping id="100>None</topping> | [en] Glazed | 101 | |
[en] Chocolate | 104 | [en] <topping id="104">Chocolate</topping> | [en] Maple | 106 | |
[en] Glazed | 101 | [en] <topping id="101">Glazed</topping> | [en] Sugar | 102 | |
[en] Glazed | 101 | [en] <topping id="101>Glazed</topping> | [en] Powdered Sugar | 103 |
[en] These results...
[en] Don't contain the root element.
[en] Don't contain the child elements of the root element.
[en] Don't contain the grandchild elements of the root element.
[en] Contain the child elements of a specified element.
[en] Contain tag formatting.