0
我有一個cXML,我試圖讀取一些值.... 我可以使用下面的代碼讀取節點值。但是我很難從同一文件中讀取「payloadID」 。任何建議如何去做呢?從xml文檔讀取值
XmlDocument xmlRequest = new XmlDocument();
XmlNodeList name = xmlRequest.GetElementsByTagName("NetworkID");
string sSecret = name[0].InnerText;
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.023/cXML.dtd">
<cXML payloadID="[email protected]"
timestamp="2012-09-11T11:55:53-07:00" version="1.2.023"
xml:lang="en-US">
<From>
<Credential domain="NetworkID">
<Identity>tnt</Identity>
</Credential>
</From>
<To>
<Credential domain="NetworkID1">
<Identity>abc</Identity>
</Credential>
</To>
</cXML>