gpt4 book ai didi

XML 文档中 inode 的 XPath

转载 作者:行者123 更新时间:2023-12-03 15:41:33 25 4
gpt4 key购买 nike

我有以下文件。我正在尝试获取 test:CategoryABCSite[0] .
尝试了 XPath $ABCCustomerHierarchy(//ata:ABCSite[0])/test:Customer/test:CustomerID/test:Category ,但我遇到了一些 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>

最佳答案

你可以试试 :

//ABCCustomerHierarchy/ABCSite[1]/Customer/CustomerID/Category

关于XML 文档中 inode 的 XPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20108034/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com