我有一个 cXML,我试图从中读取一些值。我可以使用以下代码读取节点值。但是我很难从同一个文档中读取“payloadID”。任何建议如何去做?
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="1348609345562-715426217594539696@216.109.111.69"
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>