XSLT - Using if statement to reference attribute

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bazza4846
    New Member
    • Mar 2007
    • 1

    XSLT - Using if statement to reference attribute

    Hi guys, this is probably an easy one for you, I am fairly new to this. I have taken this small chunk of xml from within a larger xml. Within the xslt I want to use an if statement. But not sure of the syntax to get each applicant.

    <invprty id="G1" index="applican t1">
    <appforename>Pe ter</appforename>
    <appsurname>Mic heals</appsurname>
    </invprty>

    <invprty id="G2" index="applican t2">
    <appforename>Sh eila</appforename>
    <appsurname>Mic heals</appsurname>
    </invprty>

    I know this test the first applicant is not blank then get the name and so on but i want to be able to pick on the index. Is that possible ?
    <xsl:if test="invprty/appforename/text()!="">
    <Firstname>
    <xsl:value-of select="."/>
    </Firstname>
    </xsl:f>

    Very much appreciate any help you can give me.

    Barry
  • sani723
    New Member
    • Feb 2007
    • 117

    #2
    <xsl:value-of select="@index" />

    Comment

    Working...