Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have problem with parsing of specific XML file. I need to extract all of the "sc:Doc number" values and "status" values from this XML.

I am not able to read this attribute, can you please help?

XML
<?xml version="1.0" encoding="UTF-8" ?>
- <sc:ar-confirmations xmlns:sc="http://" version="2.0">
  <sc:Destination>TEST</sc:Destination>
- <sc:CompanyCode Code="XX">
  <sc:Doc number="3730029466" status="C" />
  <sc:Doc number="8430000176" status="C" />
  </sc:CompanyCode>
  </sc:ar-confirmations>
Posted
Updated 9-Aug-15 1:22am
v2
Comments
Patrice T 9-Aug-15 5:25am    
What did you try ?
Václav 'Annubiz' Kaněra 9-Aug-15 5:30am    
I have just realized my problem :
XmlNodeList nodes = xmlDocument.GetElementsByTagName("sc:Doc number");

So after change to :
XmlNodeList nodes = xmlDocument.GetElementsByTagName("sc:Doc");

Everything works like charm
Patrice T 9-Aug-15 5:37am    
if you solve the problem, you should close the question.

1 solution

I have just realized my problem :
C#
XmlNodeList nodes = xmlDocument.GetElementsByTagName("sc:Doc number");


So after change to :
C#
XmlNodeList nodes = xmlDocument.GetElementsByTagName("sc:Doc");


Everything works like charm
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900