XPath not finding attribute

Here should go questions about transforming XML with XSLT and FOP.
garberfc
Posts: 2

XPath not finding attribute

Fri May 06, 2016 5:16 pm

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

Re: XPath not finding attribute

Mon May 09, 2016 3:42 pm

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']">

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest