Tôi không thể hiểu tại sao NodeList này đang rỗngXmlNodeList (tại sao là trống này)
XmlDocument document = new XmlDocument();
document.Load(xmlpath);
XmlNodeList nodes = document.SelectNodes("/StructureResponse/rootItem/attributes/Attribute");
Ở đây xmlFile
<?xml version="1.0" encoding="utf-8"?>
<StructureResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://nts-de-osm1-pxc/webservices/">
<consolidatedItems xsi:nil="true" xmlns="http://systinet.com/wsdl/com/osm/webservices/service/" />
<rootItem xsi:type="Part" xmlns="http://systinet.com/wsdl/com/osm/webservices/service/">
<attributes>
<Attribute>
<dataDictionary xsi:nil="true" />
<dataType>string</dataType>
<displayName>IDENT_NR</displayName>
<key>true</key><name>IDENT_NR</name>
<searchable>true</searchable>
<userAttribute>true</userAttribute>
<value>9662744</value>
</Attribute>
<Attribute>
<dataDictionary xsi:nil="true" />
<dataType>string</dataType>
<displayName>AI</displayName>
<key>true</key><name>AI</name>
<searchable>true</searchable>
<userAttribute>true</userAttribute>
<value>00</value>
</Attribute>
</rootItem>
</StructureResponse>
Trong Script cuối cùng tôi muốn để có được một chuỗi mảng chứa mọi thuộc tính trong đó.
Cảm ơn bạn Stefan
+1 liên kết tốt cho các không gian tên XML FAQ! Cảm ơn. –