在Price?
下获取所有节点所需的Xpath代码是什么?到目前为止,我已经尝试AMUpdate/AMMesageType/amprice/Price
,这是失败的。
<AMUpdate>
<AMMessageType>AMPRICES</AMMessageType>
<amprice:AMPrices xmlns:amprice="http://www/am.com/am/dto/price">
<Price>
<Currency>GBP</Currency>
<Country>LU</Country>
<BusinessLine>AMSL</BusinessLine>
</Price>
</amprice:AMPrices>
</AMUpdate>
答案 0 :(得分:2)
请在Xpath下面尝试,
/AMUpdate/amprice:AMPrices/Price/*
您的XML缺少结束标记。请找到更新的XML,
<AMUpdate>
<AMMessageType>AMPRICES</AMMessageType>
<amprice:AMPrices xmlns:amprice="http://www/am.com/am/dto/price">
<Price>
<Currency>GBP</Currency>
<Country>LU</Country>
<BusinessLine>AMSL</BusinessLine>
</Price>
</amprice:AMPrices>
</AMUpdate>
&#13;
您可以尝试测试XPath here