我有以下文檔。我正在嘗試獲取test:Category
在ABCSite[0]
。 嘗試了XPath $ABCCustomerHierarchy(//ata:ABCSite[0])/test:Customer/test:CustomerID/test:Category
,但我得到了一些XPath異常。用於XML文檔中索引節點的XPath
誰能告訴我正確的XPath在這裏嗎?
<test:ABCCustomerHierarchy xmlns:test="http://wwwin.test.com/testschema">
<test:ABCSite>
<test:Customer>
<test:CustomerID>
<test:ID>110984181</test:ID>
<test:Category>ABC_Customer</test:Category>
</test:CustomerID>
</test:Customer>
<test:CustomerReferences>
<test:CustomerID>
<test:ID>17808</test:ID>
<test:Category>KLM_CUSTOMER</test:Category>
</test:CustomerID>
<test:CustomerID>
<test:ID>17808</test:ID>
<test:Category>XYZ_Customer</test:Category>
</test:CustomerID>
<test:CustomerID>
<test:ID>17808</test:ID>
<test:Category>PQR_CUSTOMER</test:Category>
</test:CustomerID>
</test:CustomerReferences>
</test:ABCSite>
<test:ABCSite>
<test:Customer>
<test:CustomerID>
<test:ID>17808</test:ID>
<test:Category>XYZ_Customer</test:Category>
</test:CustomerID>
</test:Customer>
<test:CustomerReferences>
<test:CustomerID>
<test:ID>17808</test:ID>
<test:Category>PQR_CUSTOMER</test:Category>
</test:CustomerID>
</test:CustomerReferences>
</test:ABCSite>
</test:ABCCustomerHierarchy>
請,有編輯box_下方的預覽_right。你的代碼格式非常糟糕。此外,「某些」錯誤消息不起作用,顯示您收到的錯誤消息。 –