[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl Date Sorting referencing ID and data in a diff
Hello Kumar,
you can add a further key to easily access the application-elements with closedate: <xsl:key name="app-refs" match="stages/application" use="@idref"/> With this key it's a bit easier to access the nodes, with which you want to sort your application-elements. And I would change your first key so, that you are directly getting the application-element. I think the region_name is more or less uninteresting, it's only for grouping. At the end the stylesheet looks like: <xsl:key name="distinct-region" match="company/application" use="region_name"/> <xsl:key name="app-refs" match="stages/application" use="@idref"/> <xsl:template match="/"> <xsl:for-each select="rep/company/application[generate-id()=generate-id(key('distinct-region', region_name))]"> <xsl:value-of select="region_name"/> <xsl:for-each select="key('distinct-region', region_name)"> <xsl:sort select="key('app-refs',@id)/closedate"/> <xsl:value-of select="ssn"/> <xsl:value-of select="key('app-refs',@id)/closedate"/> <xsl:value-of select="key('app-refs',@id)/current"/> </xsl:for-each> </xsl:for-each> </xsl:template> Regards, Joerg XSL: 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
|