I have an XML element that looks something like:
<account year="2010">
<paymentDue>
<amount>0</amount>
</paymentDue>
<paymentDue>
<amount>752.00</amount>
</paymentDue>
</account>
I’m displaying the accounts grouped by year and I’m using the <xsl:choose> method to say if amount > 0, display a make payment link. However, I can only make this happen per payment. I’d like to display the payment link for the year if ANY of the payment due amounts are greater than 0.
Any input on how to accomplish this would be appreciated.
Like this?
The XPath expression
paymentDue[number(amount) > 0]selects any<paymentDue>node whose<amount>is greater than 0. The<xsl:if>test succeeds when this results in a non-empty node-set (i.e. when there is at least one node that fulfills the condition).