【问题标题】:Xpath question Xml XpathXpath 问题 Xml Xpath
【发布时间】:2010-03-30 22:07:15
【问题描述】:

我需要一个 xpath 表达式来返回我需要获取此节点的值的值。要提取的值是我的 xpath 表达式是 //rates/rate[loantype='30-Year Fixed Rate'] 问题在于每个节点都有一个子类型元素有三个值。除了贷款类型的过滤器之外,我还需要过滤子类型。我不确定如何在 xpath 中执行此操作。

我有以下 xml

<?xml version="1.0" standalone="yes"?>
<rates>

  <!-- START Conforming Fixed Rate -->
  <rate>
    <loantype>40-Year Fixed Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 5.375</rate>
    <points> 1.000</points>
    <apr> 5.491</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>40-Year Fixed Rate</loantype>
    <subtype>B</subtype>
    <rate> 5.500</rate>
    <points> 0.500</points>
    <apr> 5.579</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>40-Year Fixed Rate</loantype>
    <subtype>C</subtype>
    <rate> 5.625</rate>
    <points> 0.000</points>
    <apr> 5.667</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>30-Year Fixed Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 5.000</rate>
    <points> 1.000</points>
    <apr> 5.134</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>30-Year Fixed Rate</loantype>
    <subtype>B</subtype>
    <rate> 5.125</rate>
    <points> 0.500</points>
    <apr> 5.215</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>30-Year Fixed Rate</loantype>
    <subtype>C</subtype>
    <rate> 5.250</rate>
    <points> 0.000</points>
    <apr> 5.297</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>20-Year Fixed Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 4.875</rate>
    <points> 1.000</points>
    <apr> 5.055</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>20-Year Fixed Rate</loantype>
    <subtype>B</subtype>
    <rate> 5.000</rate>
    <points> 0.500</points>
    <apr> 5.121</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>20-Year Fixed Rate</loantype>
    <subtype>C</subtype>
    <rate> 5.125</rate>
    <points> 0.000</points>
    <apr> 5.187</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>15-Year Fixed Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 4.250</rate>
    <points> 1.000</points>
    <apr> 4.467</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>15-Year Fixed Rate</loantype>
    <subtype>B</subtype>
    <rate> 4.375</rate>
    <points> 0.500</points>
    <apr> 4.512</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>15-Year Fixed Rate</loantype>
    <subtype>C</subtype>
    <rate> 4.500</rate>
    <points> 0.000</points>
    <apr> 4.570</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>10-Year Fixed Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 4.125</rate>
    <points> 1.000</points>
    <apr> 4.435</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>10-Year Fixed Rate</loantype>
    <subtype>B</subtype>
    <rate> 4.250</rate>
    <points> 0.500</points>
    <apr> 4.454</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>10-Year Fixed Rate</loantype>
    <subtype>C</subtype>
    <rate> 4.375</rate>
    <points> 0.000</points>
    <apr> 4.473</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>High-Balance 15-Year Fixed Rate</loantype>
    <subtype>D</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 4.250</rate>
    <points> 1.000</points>
    <apr> 4.461</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>High-Balance 15-Year Fixed Rate</loantype>
    <subtype>B</subtype>
    <rate> 4.375</rate>
    <points> 0.500</points>
    <apr> 4.512</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>High-Balance 15-Year Fixed Rate</loantype>
    <subtype>C</subtype>
    <rate> 4.500</rate>
    <points> 0.000</points>
    <apr> 4.563</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>High-Balance 30-Year Fixed Rate</loantype>
    <subtype>D</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 5.000</rate>
    <points> 1.000</points>
    <apr> 5.130</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>High-Balance 30-Year Fixed Rate</loantype>
    <subtype>B</subtype>
    <rate> 5.125</rate>
    <points> 0.500</points>
    <apr> 5.211</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>High-Balance 30-Year Fixed Rate</loantype>
    <subtype>C</subtype>
    <rate> 5.250</rate>
    <points> 0.000</points>
    <apr> 5.293</apr>
    <jumbo>0</jumbo>
    <fixed>1</fixed>
  </rate>
  <!-- END Conforming Fixed Rate -->

  <!-- START Non Conforming Fixed Rate -->
  <rate>
    <loantype>30-Year Fixed Rate Jumbo</loantype>
    <subtype>A</subtype>
        <subtypeCount>2</subtypeCount>
    <rate> 5.125</rate>
    <points> 1.000</points>
    <apr> 5.254</apr>
    <jumbo>1</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>30-Year Fixed Rate Jumbo</loantype>
    <subtype>B</subtype>
    <rate> 5.250</rate>
    <points> 0.500</points>
    <apr> 5.336</apr>
    <jumbo>1</jumbo>
    <fixed>1</fixed>
  </rate>
  <!--<rate>
    <loantype>30-Year Fixed Rate Jumbo</loantype>
    <subtype>C</subtype>
    <rate> 5.375</rate>
    <points> 0.000</points>
    <apr> 5.417</apr>
    <jumbo>1</jumbo>
    <fixed>1</fixed>
  </rate>-->
  <rate>
    <loantype>15-Year Fixed Rate Jumbo</loantype>
    <subtype>A</subtype>
        <subtypeCount>2</subtypeCount>
    <rate> 5.000</rate>
    <points> 1.000</points>
    <apr> 5.220</apr>
    <jumbo>1</jumbo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>15-Year Fixed Rate Jumbo</loantype>
    <subtype>B</subtype>
    <rate> 5.125</rate>
    <points> 0.500</points>
    <apr> 5.270</apr>
    <jumbo>1</jumbo>
    <fixed>1</fixed>
  </rate>
  <!--<rate>
    <loantype>15-Year Fixed Rate Jumbo</loantype>
    <subtype>C</subtype>
    <rate> 5.250</rate>
    <points> 0.000</points>
    <apr> 5.320</apr>
    <jumbo>1</jumbo>
    <fixed>1</fixed>
  </rate>-->
  <!-- END Non Conforming Fixed Rate -->


  <!-- START Conforming Adjustable Rate -->
  <rate>
    <loantype>3/1 30-Year Adjustable Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 3.625</rate>
    <points> 1.000</points>
    <apr> 3.431</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>3/1 30-Year Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 3.875</rate>
    <points> 0.500</points>
    <apr> 3.448</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>3/1 30-Year Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 4.125</rate>
    <points> 0.000</points>
    <apr> 3.465</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>3/1 40-Year Adjustable Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 3.875</rate>
    <points> 1.000</points>
    <apr> 3.438</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>3/1 40-Year Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 4.125</rate>
    <points> 0.500</points>
    <apr> 3.453</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>3/1 40-Year Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 4.375</rate>
    <points> 0.000</points>
    <apr> 3.467</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>5/1 30-Year Adjustable Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 3.375</rate>
    <points> 1.000</points>
    <apr> 3.401</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>5/1 30-Year Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 3.625</rate>
    <points> 0.500</points>
    <apr> 3.457</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>5/1 30-Year Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 3.875</rate>
    <points> 0.000</points>
    <apr> 3.514</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>5/1 40-Year Adjustable Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 3.625</rate>
    <points> 1.000</points>
    <apr> 3.441</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>5/1 40-Year Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 3.875</rate>
    <points> 0.500</points>
    <apr> 3.481</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>5/1 40-Year Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 4.125</rate>
    <points> 0.000</points>
    <apr> 3.531</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>7/1 30-Year Adjustable Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 3.875</rate>
    <points> 1.000</points>
    <apr> 3.670</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>7/1 30-Year Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 4.125</rate>
    <points> 0.500</points>
    <apr> 3.755</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>7/1 30-Year Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 4.375</rate>
    <points> 0.000</points>
    <apr> 3.841</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>10/1 30-Year Adjustable Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 4.375</rate>
    <points> 1.000</points>
    <apr> 4.092</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>10/1 30-Year Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 4.625</rate>
    <points> 0.500</points>
    <apr> 4.217</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>10/1 30-Year Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 4.875</rate>
    <points> 0.000</points>
    <apr> 4.342</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>-->
  <!--<rate>
    <loantype>2/2 ARM 30-Year (Purchase only)</loantype>
    <subtype>DH</subtype>
    <rate> 5.250</rate>
    <points> 0.000</points>
    <apr> 3.709</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>-->
  <rate>
    <loantype>High-Balance 5/1 30-Year Adjustable Rate</loantype>
    <subtype>D</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 3.375</rate>
    <points> 1.000</points>
    <apr> 3.366</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>High-Balance 5/1 30-Year Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 3.625</rate>
    <points> 0.500</points>
    <apr> 3.404</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>High-Balance 5/1 30-Year Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 3.875</rate>
    <points> 0.000</points>
    <apr> 3.454</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>High-Balance 7/1 30-Year Adjustable Rate</loantype>
    <subtype>D</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 3.875</rate>
    <points> 1.000</points>
    <apr> 3.670</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>High-Balance 7/1 30-Year Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 4.125</rate>
    <points> 0.500</points>
    <apr> 3.755</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>High-Balance 7/1 30-Year Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 4.375</rate>
    <points> 0.000</points>
    <apr> 3.841</apr>
    <jumbo>0</jumbo>
    <fixed>0</fixed>
  </rate>
  <!-- END Conforming Adjustable Rate -->

  <!-- START Non Conforming Adjustable Rate -->

  <rate>
    <loantype>3/1 30-Year Jumbo Adjustable Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>2</subtypeCount>
    <rate> 4.875</rate>
    <points> 1.000</points>
    <apr> 3.719</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>3/1 30-Year Jumbo Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 5.000</rate>
    <points> 0.500</points>
    <apr> 3.708</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>
  <!--<rate>
    <loantype>3/1 30-Year Jumbo Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 5.125</rate>
    <points> 0.000</points>
    <apr> 3.704</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>-->
  <rate>
    <loantype>3/1 40-Year Jumbo Adjustable Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>2</subtypeCount>
    <rate> 5.250</rate>
    <points> 1.000</points>
    <apr> 3.733</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>3/1 40-Year Jumbo Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 5.375</rate>
    <points> 0.500</points>
    <apr> 3.727</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>
  <!--<rate>
    <loantype>3/1 40-Year Jumbo Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 5.500</rate>
    <points> 0.000</points>
    <apr> 3.725</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>-->
  <rate>
    <loantype>5/1 30-Year Jumbo Adjustable Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>3</subtypeCount>
    <rate> 4.375</rate>
    <points> 1.000</points>
    <apr> 3.791</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>5/1 30-Year Jumbo Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 4.500</rate>
    <points> 0.500</points>
    <apr> 3.803</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>5/1 30-Year Jumbo Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 4.625</rate>
    <points> 0.000</points>
    <apr> 3.814</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>5/1 40-Year Jumbo Adjustable Rate</loantype>
    <subtype>A</subtype>
        <subtypeCount>2</subtypeCount>
    <rate> 5.000</rate>
    <points> 1.000</points>
    <apr> 3.922</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>5/1 40-Year Jumbo Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 5.125</rate>
    <points> 0.500</points>
    <apr> 3.925</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>
  <!--<rate>
    <loantype>5/1 40-Year Jumbo Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 5.250</rate>
    <points> 0.000</points>
    <apr> 3.936</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>-->
  <rate>
    <loantype>7/1 30-Year Jumbo Adjustable Rate</loantype>
    <subtype>A</subtype>
    <subtypeCount>3</subtypeCount>
    <rate> 4.950</rate>
    <points> 1.000</points>
    <apr> 4.261</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>7/1 30-Year Jumbo Adjustable Rate</loantype>
    <subtype>B</subtype>
    <rate> 5.075</rate>
    <points> 0.500</points>
    <apr> 4.286</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>
  <rate>
    <loantype>7/1 30-Year Jumbo Adjustable Rate</loantype>
    <subtype>C</subtype>
    <rate> 5.200</rate>
    <points> 0.000</points>
    <apr> 4.311</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>
  <!--<rate>
    <loantype>2/2 ARM 30-Year Jumbo (Purchase only)</loantype>
    <subtype>DH</subtype>
    <rate> 6.500</rate>
    <points> 0.000</points>
    <apr> 4.260</apr>
    <jumbo>1</jumbo>
    <fixed>0</fixed>
  </rate>-->
  <!-- END Non Conforming Adjustable Rate -->

  <!-- START Other loans -->
  <rate>
    <loantype>30 Due in 7 Fixed Rate JUMBO Balloon</loantype>
    <subtype>A</subtype>
    <rate> 6.375</rate>
    <points> 1.000</points>
    <apr> 6.613</apr>
    <jumbo>1</jumbo>
    <promo>0</promo>
  </rate>
  <rate>
    <loantype>30 Due in 7 Fixed Rate JUMBO Balloon</loantype>
    <subtype>B</subtype>
    <rate> 6.500</rate>
    <points> 0.500</points>
    <apr> 6.625</apr>
    <jumbo>1</jumbo>
    <promo>0</promo>
  </rate>
  <rate>
    <loantype>40 due in 7 Fixed Rate</loantype>
    <subtype>offer1</subtype>
    <rate> 5.250</rate>
    <points> 0.000</points>
    <apr> 5.374</apr>
    <jumbo>0</jumbo>
    <promo>0</promo>
    <fixed>1</fixed>
  </rate>
  <rate>
    <loantype>40 Due in 7 Fixed Rate JUMBO Balloon</loantype>
    <subtype>offer2</subtype>
    <rate> 6.500</rate>
    <points> 0.000</points>
    <apr> 6.625</apr>
    <jumbo>1</jumbo>
    <promo>0</promo>
    <fixed>1</fixed>
  </rate>
  <!-- END Other loans -->

  <!-- START Interest Only HELOC -->
    <rate>
    <loantype>Interest Only HELOC</loantype>
    <subtype>A</subtype>
    <ltv>To 80% LTV</ltv>
    <rate>3.250</rate>
    <jumbo>0</jumbo>
    <promo>1</promo>
  </rate>
  <!-- END Interest Only HELOC -->

  <!-- START Home Equity Loans -->

  <rate>
    <loantype>Home Equity Loan - 7Yrs</loantype>
    <subtype>A</subtype>
    <amount>Up to $100,000.00</amount>
    <ltv>Up to 75% LTV</ltv>
    <rate>6.000</rate>
    <apr>6.000</apr>
    <jumbo>0</jumbo>
    <promo>2</promo>
  </rate> 
  <rate>
    <loantype>Home Equity Loan - 7Yrs</loantype>
    <subtype>A</subtype>
    <amount>$100,000.01 - $250,000.00</amount>
    <ltv>Up to 75% LTV</ltv>
    <rate>6.00</rate>
    <apr>6.153</apr>
    <jumbo>0</jumbo>
    <promo>2</promo>
  </rate>
  <rate>
    <loantype>Home Equity Loan - 7Yrs</loantype>
    <subtype>A</subtype>
    <amount>Up to $100,000.00</amount>
    <ltv>Up to 80% LTV</ltv>
    <rate>6.250</rate>
    <apr>6.250</apr>
    <jumbo>0</jumbo>
    <promo>2</promo>
  </rate>
  <rate>
    <loantype>Home Equity Loan - 7Yrs</loantype>
    <subtype>A</subtype>
    <amount>$100,000.01 - $250,000.00</amount>
    <ltv>Up to 80% LTV</ltv>
    <rate>6.25</rate>
    <apr>6.403</apr>
    <jumbo>0</jumbo>
    <promo>2</promo>
  </rate>
    <!--rate>
    <loantype>Home Equity Loan - 7Yrs</loantype>
    <subtype>B</subtype>
    <amount>$100,000.01 - $250,000.00</amount>
    <ltv>Up to 90% LTV</ltv>
    <rate>6.99</rate>
    <apr>7.145</apr>
    <jumbo>0</jumbo>
    <promo>2</promo>
  </rate-->
  <rate>
    <loantype>Home Equity Loan - 10,15Yrs</loantype>
    <subtype>C</subtype>
    <amount>$5,000-$250,000.00</amount>
    <ltv>To 75% LTV</ltv>
    <rate>6.50</rate>
    <apr>6.612</apr>
    <jumbo>0</jumbo>
    <promo>2</promo>
  </rate>
  <rate>
    <loantype>Home Equity Loan - 10,15Yrs</loantype>
    <subtype>C</subtype>
    <amount>$5,000-$250,000.00</amount>
    <ltv>To 80% LTV</ltv>
    <rate>6.75</rate>
    <apr>6.863</apr>
    <jumbo>0</jumbo>
    <promo>2</promo>
  </rate>
    <!--rate>
    <loantype>Home Equity Loan - 10,15Yrs</loantype>
    <subtype>D</subtype>
    <amount>$5,000-$250,000.00</amount>
    <ltv>Up to 90% LTV</ltv>
    <rate>7.50</rate>
    <apr>7.614</apr>
    <jumbo>0</jumbo>
    <promo>2</promo>
  </rate-->
  <rate>
    <loantype>Home Equity Loan - 20Yrs</loantype>
    <subtype>E</subtype>
    <amount>$5,000-$250,000.00</amount>
    <ltv>To 75% LTV</ltv>
    <rate>7.50</rate>
    <apr>7.566</apr>
    <jumbo>0</jumbo>
    <promo>2</promo>
  </rate>
  <rate>
    <loantype>Home Equity Loan - 20Yrs</loantype>
    <subtype>E</subtype>
    <amount>$5,000-$250,000.00</amount>
    <ltv>To 80% LTV</ltv>
    <rate>7.75</rate>
    <apr>7.817</apr>
    <jumbo>0</jumbo>
    <promo>2</promo>
  </rate>
    <!--rate>
    <loantype>Home Equity Loan - 20Yrs</loantype>
    <subtype>F</subtype>
    <amount>$5,000-$250,000.00</amount>
    <ltv>Up to 90% LTV</ltv>
    <rate>8.50</rate>
    <apr>8.569</apr>
    <jumbo>0</jumbo>
    <promo>2</promo>
  </rate-->
  <rate>
    <loantype>Equity Edge</loantype>
    <amount>$5,000-$25,000.00</amount>
    <ltv>Up to 125% LTV</ltv>
    <rate>12.00</rate>
    <apr>12.188</apr>
  </rate>
  <!-- END Home Equity Loans -->


<!-- INDEXES -->  
<!-- INDEXES -->  
<!-- INDEXES -->  
<!-- INDEXES -->  

  <rate1>
    <loantype>Current Index</loantype>
    <index>0.350</index>
  </rate1>
  <rate1>
    <loantype>Prime Index</loantype>
    <index>3.250</index>
  </rate1>

<!-- EFFECTIVE -->  
<!-- EFFECTIVE -->  
<!-- EFFECTIVE -->  
<!-- EFFECTIVE -->  

  <rate2>
    <effective>03/26/2010</effective>
  </rate2>
</rates>

【问题讨论】:

  • 不确定如何显示问题中的 xml

标签: xml xpath


【解决方案1】:

您可以在谓词 e 中使用 andor 运算符。 g.

//rates/rate[loantype='30-Year Fixed Rate' and subtype='B']

获取所有贷款类型为“30 年固定利率”且子类型为“B”的利率。另一种选择是使用多个谓词(它的工作方式类似于and 运算符)。所以上面的例子也可能看起来像

//rates/rate[loantype='30-Year Fixed Rate'][subtype='B']

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-11
    • 1970-01-01
    • 1970-01-01
    • 2011-06-21
    • 2010-10-07
    • 2013-10-15
    相关资源
    最近更新 更多