XML文件解析问题[已解决] [英] XML file parsing problem [Solved]
本文介绍了XML文件解析问题[已解决]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解析特定的XML文件时遇到问题。我需要从这个XML中提取所有sc:Doc number值和status值。
我无法读取这个属性,你能不能请帮忙?
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 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>
推荐答案
我刚刚意识到我的问题:
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
这篇关于XML文件解析问题[已解决]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文