查找荷载类型为"40 年固定"且子类型为"A"的比率

  • 本文关键字:类型 比率 查找 xpath
  • 更新时间 :
  • 英文 :


我有以下html结构{code}

<rate>
<loantype>40-Year Fixed Rate</loantype>
<subtype>A</subtype>
<rate> 5.500</rate>
<points> 0.500</points>
<apr> 5.579</apr>
<jumbo>0</jumbo>
<fixed>1</fixed>
</rate>

{代码}。。。并且需要定位loantype为"0"的速率的xPath;40年固定利率";并且亚型是";A";使用祖先或子代和父代。有人能帮我吗?

如果您的xml看起来像这样:

<rates>
<rate>
<loantype>40-Year Fixed Rate</loantype>
<subtype>A</subtype>
<rate> 5.500</rate>
<points> 0.500</points>
<apr> 5.579</apr>
<jumbo>0</jumbo>
<fixed>1</fixed>
</rate>
<rate>
<loantype>10-Year Floating Rate</loantype>
<subtype>B</subtype>
<rate> 3.500</rate>
<points> 0.500</points>
<apr> 5.579</apr>
<jumbo>0</jumbo>
<fixed>1</fixed>
</rate>
</rates>

这个xpath表达式

//rate[loantype="40-Year Fixed Rate"][subtype="A"]/rate

应选择

5.500

最新更新