fvalencia
(Fernando Valencia)
January 11, 2025, 7:34am
1
hi people, I need to read XML files (Invoices ) from a folder and then transform to a excel format - 1 line for each invoice item
I review some videos and solutions for XML data extraction but those XML has particular structure as you see in the picture.
the structure has a namespace, so this is necesary to deserialice the XML - Done
My problem is that I can not get the information from the elements
I review diferent modes, but can not get the data.
1.- Descendants
2.- Finding the tag element
both sentence retrieve 0 items
archivoXML.Descendants(xmlNS + “InvoiceLine”)
archivoXML.Root.Elements(xmlNS + “InvoiceLine”)
please any recomendation/suggestion/help?
ppr
(Peter Preuss)
January 11, 2025, 2:01pm
2
Have a look here:
Going ahead
Serializing the XML - output: xDoc | DataType: XDocument:
[grafik]
Checking if we have to handle XML namespaces
[grafik]
We do have:
[grafik]
Checking for some children:
[grafik]
Defining Namespace Variable
[grafik]
In some cases, we can also do: Assign Activity - xnsDefault = xDoc.Root.Name.Namespace
Checkin the retrieval
[grafik]
xDoc.Descendants(xnsDefault + "productVersion")
GetDescendants { [<productVersion build="456" xmlns="http://tableau.com/api">123</…
it will also help with the analysis of which namespace is to use. Keep in mind that multiple namespaces are defined within the XML and may be to handle for the extractions
1 Like
fvalencia
(Fernando Valencia)
January 19, 2025, 4:22pm
3
excelent, I understood and solved the issue,
thanks guy
ppr
(Peter Preuss)
January 19, 2025, 7:01pm
4
Perfect, so the topic can bei closed
Forum FAQ - How to mark a post as a solution
This document is part of our beginners guide .
This article will teach you how to properly mark a post as a solution.
We were closely following our last UiPath Forum feedback round! topic and carefully extracted all the bits of feedback that was provided. As such, we would like to tackle the topic of solutions on our Forum and how to properly use them.
When is the topic resolved?
The topic can be considered resolved when the topic author has found…