GET Attribute from XML

In the xml below, how to get the data inside the attribute, I’ve tried many ways and I’m not succeeding

test.xml (9.8 KB)

@Israel_Silva

Please check this follow the steps

Cheers

Using the mentioned tutorial, I couldn’t find the CNPJ value in the XML, when I try to specify the element, the result is always Null

Cheers!!

@Israel_Silva
Kindly note: the provided XML was incomplete we did repair for some prototyping

CNPJ is an element

we dont know the details, what was done

as discussed: it was checked and setup the default Namespace:
grafik

And when fetching the CNPJ elements the namespace is used:
grafik

So we would recommend to incorporate the namespace handling as well in your modelling

Thank you very much, in this case I need to get the second number, but when I put it in a for each it brings me a whole string:04895728000180

How do I get just the numbers without using regex, how?

we would loop over the descendants return
xDoc.root.Descendants(xnsDefault + "CNPJ").
Or
Access directly the second one
Or
catch all values

Find some samples:
grafik

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.