I know there are other topics regarding this subject, but I have never worked with XML and I can’t understand about elements, attributes …
I tried to risk with the content I saw, but nothing. I need to extract from the XML the
nNF, dhEmi, emit><CNPJ, vICMS
I need to extract this information from various XML
within a directory and then fill it in another application and I don’t even know how to get started. Can someone give me a push rs a north to start.
remembering that I’ve read tutorials like this
xmlDoc.Element(activities+“Activity”) is the anchor, right?
I can’t identify why it changes in the case of “x”
I understand your code, but I have difficulty locating the anchor and attributes by myself, I’m looking for the XML structure the electronic invoices of the Brazil to try to understand, but it’s hard lol
the x references a variable which points to a namespace (xlmns detailed at the top of xml files). So for certain nodes in the XML they will be prefixed with these to avoid conflicts in the naming of resources in the file, and are created by the author. They can be named anything really but on occasion you’ll see the use of URLs, used simply because they are unlikely to be conflicts, they perform no technical functionality.
There is certainly a more direct way of doing this but this basically allows you just to give the Xelement name that you wish to see the value of. You should just be able to directly act on the XML object through the element names, but it is possibly due to the value types I have been passing. However this is a workaround for now.
In your case, you simply provide the bot with the name of the element, “nNF” and it will return the value, “10410”. It will work for all others as well.