【问题标题】:XPath evaluation failingXPath 评估失败
【发布时间】:2018-03-31 16:42:14
【问题描述】:

获取 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>

【问题讨论】:

    标签: xpath


    【解决方案1】:

    请在 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>

    您可以尝试测试 XPath here

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-09-16
    • 2016-06-12
    • 2020-04-21
    • 2010-11-03
    • 1970-01-01
    • 2013-07-13
    • 2022-08-24
    • 2017-01-11
    相关资源
    最近更新 更多