|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Grouping and filtering
Bernard.. The following code will help you.. This XSL does both the sorting which you have asked for. 1. it prints the group name based on the item 2. it prints the group name based on the items starting with a string. The first is fairly simple and the code is self explainatory The second accepts a String parameter as a filter_string.. and does the filtering based on parameter. The XSL is intended to output HTML format file the code follows <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:key name = "groupname" match = "/groups/group" use = "item"/> <xsl:param name="filter"/> <xsl:template match="/"> <xsl:for-each select="/groups/group/item[not(. = preceding::item)]"> groups of item name : <xsl:value-of select="."/><br/> <xsl:for-each select="key('groupname',.)"> <xsl:value-of select="@name"/><br/> </xsl:for-each><hr/> </xsl:for-each> <hr/> groups of item name starting from <xsl:value-of select="$filter"/><br/> <xsl:for-each select="/groups/group/item[(not(. = preceding::item)) and (starts-with(., $filter))]"> Name:<xsl:value-of select="."/><br/> <xsl:for-each select="key('groupname',.)"> <xsl:value-of select="@name"/><br/> </xsl:for-each><hr/> </xsl:for-each> </xsl:template> </xsl:stylesheet> Hope this helps Vasu From: "Bernard Delporte" <bdelporte@xxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: "XSL-List@xxxxxxxxxxxxxxxxxxxxxx" <XSL-List@xxxxxxxxxxxxxxxxxxxxxx> Subject: Grouping and filtering Date: Wed, 03 Jul 2002 15:08:19 +0200 (MSZ) _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx 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








