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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sort on a value of an attribute

Status
Not open for further replies.

kgbboy

Technical User
Jan 17, 2004
1
BE
I want to sort on the value of an attribute. How is this possible?
When i want to sort on the value of an element then i can just use the following code:
<xsl:choose>
<xsl:when test=&quot; catalogue/book/title='My first book' &quot;>
... some code ...
</xsl:when>
<xsl:eek:therwise>
... some code ....
</xsl:eek:therwise>
</xsl:choose>
 

Assuming an xml file like this
<catalogue>
<book>
<title isbn>
</title>
</book>
</catalogue>



ur xpath statement should look like this

<xsl:choose>
<xsl:when test=&quot;catalogue/book/title[@isbn='12345']&quot;>
... some code ...
</xsl:when>
<xsl:eek:therwise>
... some code ....
</xsl:eek:therwise>
</xsl:choose>


hope this helps

simon

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top