Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT - Referring to an attribute 1

Status
Not open for further replies.

ddrillich

Technical User
Jun 11, 2003
546
US
Good Day,

I have the following code, which works just fine for the element values -

Code:
<xsl:for-each select="autnresponse/responsedata/field/value">
    <value count="1"><xsl:value-of select="."/></value>
</xsl:for-each>

However, autnresponse/responsedata/field/value has an attribute called count.
How can I refer to count in this for-each loop?

Regards,
Dan
 
If you want it to appear in the count attribute, it looks like this.
[tt] <value count="{@count}"><xsl:value-of select="."/></value>[/tt]
If you want it to appear as the text node, this.
[tt] <value count="1"><xsl:value-of select="@count"/></value>[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top