XPath not finding attribute

Here should go questions about transforming XML with XSLT and FOP.
garberfc
Posts: 2
Joined: Fri May 06, 2016 5:08 pm

XPath not finding attribute

Post by garberfc »

Hello All,

I have the following XML structure:
<document>
<scheduled_payments>
<scheduled_payment id="31533715" status="ACTIVE" updated_user="0" type="EXTERNAL_TRANSFER">
<amount value="-50" formattedValue="-50.00"/>

I have this variable setup:
<xsl:param name="paymentList" select="/pp:document/pp:scheduled_payments/pp:scheduled_payment"/>

I'm trying to test if the type is EXTERNAL_TRANSFER but I can't figure out the syntax for it!
<xsl:for-each select="$paymentList">
<xsl:when test="./@type='EXTERNAL_TRANSFER'">

The for-each loop is looping through the <scheduled_payment> nodes, I just can't seem to get the value of the 'type'...

All help is appreciated...

Frank
garberfc
Posts: 2
Joined: Fri May 06, 2016 5:08 pm

Re: XPath not finding attribute

Post by garberfc »

I was able to figure out the solution. Encase others find themselves in a similar problem, here's the solution:

<xsl:if test="self::*[@type='EXTERNAL_TRANSFER']">
Post Reply