Page 1 of 1

XPath not finding attribute

Posted: Fri May 06, 2016 5:16 pm
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

Re: XPath not finding attribute

Posted: Mon May 09, 2016 3:42 pm
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']">