|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] AW: Finding node having maximum value for an attribute
Yes, you can. You can sort the Archive-nodes using the ID with xsl:sort and extract the first or last node of the sorted tree. <xsl:variable name="max"> <xsl:sort data-type="number" select="//Archive/@ID" order="descending"/> <xsl:value-of select="//Archive[1]/@ID"/> </xsl:variable> JP -----Ursprüngliche Nachricht----- Von: Bagchi Ratul [mailto:bratul@xxxxxxxx] Gesendet: Freitag, 31. Mai 2002 10:24 An: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Betreff: Finding node having maximum value for an attribute Hi, I have a XML which has the following structure : <Archives> <Archive ID="1"> <somenode>somevalue</somenode> <someothernode>someothervalue</someothernode> </Archive> <Archive ID="2"> <somenode>somevalue</somenode> <someothernode>someothervalue</someothernode> </Archive> </Archives> Now my question is, is it possible to wite a XPath query which will return me the highest ID attribute if Archive node in the whole file??? Regards, Ratul. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








