我有以下 XML
<DataTable xmlns = "http://schemas.datacontract.org/2004/07/System.Data">
<xs:schema
id = "NewDataSet"
xmlns = ""
xmlns:xs = "http://www.w3.org/2001/XMLSchema"
xmlns:msdata = "urn:schemas-microsoft-com:xml-msdata">
<xs:element
name = "NewDataSet"
msdata:IsDataSet = "true"
msdata:MainDataTable = "Table"
msdata:UseCurrentLocale = "true">
<xs:complexType>
<xs:choice minOccurs = "0" maxOccurs = "unbounded">
<xs:element name = "Table">
<xs:complexType>
<xs:sequence>
<xs:element
name = "Id"
type = "xs:int"
minOccurs = "0"/>
<xs:element
name = "Industry"
type = "xs:string"
minOccurs = "0"/>
<xs:element
name = "ParentId"
type = "xs:int"
minOccurs = "0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata = "urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr = "urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns = "">
<Table diffgr:id = "Table1" msdata:rowOrder = "0">
<Id>1592</Id>
<Industry>Fortune 100</Industry>
<ParentId>1810</ParentId>
</Table>
<Table diffgr:id = "Table2" msdata:rowOrder = "1">
<Id>1601</Id>
<Industry>Oil & Gas Operations</Industry>
<ParentId>0</ParentId>
</Table>
</NewDataSet>
</diffgr:diffgram>
</DataTable>
我需要 parentID = 0 的节点
但是当我使用以下代码时:
Dim parentNodes As XmlNodeList = xml_node.SelectNodes("/DataTable/diffgr:diffgram/NewDataSet/Table[ParentId=0]")
我收到这个错误
需要命名空间管理器或 XsltContext。此查询具有前缀、变量或用户定义的函数。
请提出解决方案