Hi,
I am unable to parse XML file that we received from a server. the file is saved as XXX.xml.txt
below is my workflow, config settings and errors.
Hi @Wafarian ,
Thank you for the data. It makes the discussion more effective.
I tried to parse it as below. Please let me know if this is close to your needs.
Workflow
Summarize tool puts the rows into one cell together.
1st XML Parse tool focuses on "Item" tag as you says you don't need data in "Head" tag.
2nd XML Parse tool parses all the tags under "Amount" tag.
Output
Hey @Wafarian, have you tried reading it in as an XML?
the file is saved as TXT but has an XML structure.
Hey @Wafarian, if you pull on an Input Data tool and then choose your file, you can still just select to read it in as an XML from the dropdown, even though it's a .txt - see here:
Getting error "Error: XML Parse (2): invalid document structure at Line:3 and Column:7 at value"
Thanks,
@Wafarian I'm not too experienced working with XML but because of the nesting I think you may need to do an initial parse of your field for the <Item> tag - you can search for a specific child by using this configuration like so:
The resulting fields of that should then have the <Amount> data, that you can use a second XML Parse tool to go over. In this example the <Fields> data that's nested within the configuration would be what I'd parse in my second tool:
Hi @Wafarian
Can you attach the actual xml file, as opposed to an image of it? The error messages suggest that the file is badly structured, but it looks correct in the image.
Thanks
Dan
Just chiming in to support @danilang 's suggestion - I don't even see a line 3 in the screengrab....