[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Return the max value of a set of nodes using FLWR
At 2012-05-25 08:10 -0400, Philip Vallone wrote:
How can I return the max value of a set of nodes using FLWR? In this example I want to return: You've gone too deep ... you want to stop one level "up" and get the maximum of each of the sets. I hope this helps. . . . . . . Ken T:\ftemp>type philip.xml <data> <set> <changenumber>0</changenumber> <changenumber>3</changenumber> <changenumber>0</changenumber> </set> <set> <changenumber>0</changenumber> <changenumber>2</changenumber> <changenumber>1</changenumber> </set> <set> <changenumber>0</changenumber> </set> </data> T:\ftemp>xslt2 philip.xml philip.xsl <?xml version="1.0" encoding="UTF-8"?>3 2 0 T:\ftemp>type philip.xsl <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:template match="/"> <xsl:sequence select="for $s in /data/set return max($s/changenumber)"/> </xsl:template> </xsl:stylesheet> T:\ftemp>
|
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
|