I want to perform a XML parsing, and I would like to know each element they are under which parent element.
Expected output
Name | Value | Parent Name |
formid | ABC0123 | form |
captchaMethod | AA_Hello | form |
... | ... | ... |
trnid | AA012363QPS2RTVS | submit |
Thanks so much !!
Solved! Go to Solution.
Hi @tamluenwai
Is this what you are looking for as output?
If yes, please find my workflow for your reference.
Hi kelvin, thanks for your help. The output of your workflow is closely fulfill my expected output.
But I got some limitation of my workflow:
For the input tools configuration,
I have to set the file format as "Extensible Markup Language (*.xml)", instead of "Comma Separated Value (*.csv). Here's the configuration and the output result of after executing the input tool.
Subsequently, I have dragged a "XML Parse" tool after the "Input tool", and the configuration and output as follow:
Therefore, I would like to know how can i perform the same result as your workflow based on this 2 limitation.
Again, thanks for your help. I have attached my workflow in this message down below for your references.
Hi Kelvin,
I got another xml file, with 3 different child "form", "submit", "data" under the parent "submission", I found that I am not able to obtain the same result by using your workflow. It seems that Alteryx cannot parse the XML with 3 different child elements?
I have attached the latest XML file in this message down below for your references. Thank you for your kind assistance, looking forward to hearing from you soon.
Hi @tamluenwai,
It's a little tricky to use the Input Tool for XML type with complicated XML format.
I have modified the workflow based on your requirements. Couple things that I have changed here:
1. Changed the Input Tool for XML type with Return Root Element and Return Outer XML options checked.
2. Since it's a nested XML format, there will be an additional Submission element. I used a Filter tool to filter that element out.
3. Used Regex to split the element into multiple rows.
Hope it works for your use case.