Reputation: 409
Here's the code from the XML I'm trying to pull:
<ticket_price type="adult" status="available">25.00</ticket_price>
<ticket_price type="child" status="none">11.00</ticket_price>
<ticket_price type="junior" status="available">0.00</ticket_price>
and this is the xslt I'm working with:
<xsl:for-each select="ticket_price">
<xsl:element name="tickets">
<xsl:value-of select="ticket_price"/>
<xsl:element name="br"/>
<xsl:value-of select="@type"/>
<xsl:element name="br"/>
<xsl:value-of select="@status"/>
</xsl:element>
</xsl:for-each>
The problem I'm having is that when I run the XSL transformer, only the type and status are being shown, not the price of the tickets. Eg:
<tickets><br>adult<br>available</tickets>
<tickets><br>child<br>none</tickets>
<tickets><br>junior<br>available</tickets>
Any advice on how I should be doing this?
Upvotes: 0
Views: 55
Reputation: 42483
Instead of <xsl:value-of select="ticket_price"/>
do <xsl:value-of select="."/>
because you are already at the ticket_price
node.
Upvotes: 2