0

What would be the exact XPath expression to set a variable this is in a for each of another element. So far I have variable below but I also need to know the amount is greater than 0 to stop further processing can I do this in one select?

XSL so far

<xsl:variable name="UM" select="LossPayment/Coverage[contains('UM',CoverageCd)]"/>
<xsl:if test="$UM">
         ....          
</xsl:if>

XML

  <Parent>
    <LossPayment>
       <Coverage>
           <CoverageCd>TL</CoverageCd>
       </Coverage>
       <LossPaymentAmt>
               <Amt>000009500</Amt>
       </LossPaymentAmt>
    </LossPayment>
    <LossPayment>
       <Coverage>
            <CoverageCd>UM</CoverageCd>
        </Coverage>
        <LossPaymentAmt>
             <Amt>1</Amt>
       </LossPaymentAmt>
    </LossPayment>
  </Parent>
4

1 回答 1

0

这应该有效。

<xsl:if test="/Parent/LossPayment[Coverage/CoverageCd='UM' and LossPaymentAmt/Amt &gt; 0]">
   <!-- do whatever you want -->
</xsl:if>
于 2012-12-07T15:18:50.067 回答