|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Sorting and position
The question I have is how to I sort a node-list, then take only part of it. Say for example I have: <Products> <Product> <Name>B</Name> </Product> <Product> <Name>C</Name> </Product> <Product> <Name>A</Name> </Product> <Product> <Name>F</Name> </Product> </Products> and what I want to do is do something with the first two <Product> elements, but I need to sort them by name first. If I do this: <xsl:template match="Products[position() >= 0 and position <= 1]"> <xsl:for-each select="Product"> <xsl:sort select="Name"/> <xsl:value-of select="Name"/> </xsl:for-each> </xsl:template> I end up with the first two in document order, then sorted. How can I come out with the first two in alpha order by Name? Thanks, Patrick Patrick Cauldwell patc@xxxxxxxxxxxx (503) 892-4738 STEP Technology, Inc. 6915 SW Macadam Suite 200, Portland, OR 97219 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








