|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Find the node with maximum elements
On 11/4/07, G. Ken Holman <gkholman@xxxxxxxxxxxxxxxxxxxx> wrote: > Which is what I already indicated in my response: > > At 2007-11-03 15:19 -0400, G. Ken Holman wrote: > >You can optimize the speed by putting the max value into a variable > >and testing against that Sorry, Ken. Unfortunately, I didn't read your post completely. > <?xml version="1.0" encoding="US-ASCII"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="2.0"> > > <xsl:output method="text"/> > > <xsl:template match="/"> > <xsl:value-of select="/Sample/*[count(Car)=max(/Sample/*/count(Car))] > /name(.)" > separator="
"/> > </xsl:template> > > </xsl:stylesheet> This solution is nice. But if the OP wants to do something else with the result (not just printing the result (sequence), as this solution demonstrates), then I think xsl:for-each loop will be necessary. -- Regards, Mukul Gandhi
|
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
|






