[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Simple Xsl Problem

Subject: Re: Simple Xsl Problem
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Mon, 10 Nov 2003 01:38:27 +0100
simple xsl
Nischal wrote:
I trying to build a generic xsl transform which would
pick up all the unique Orders(Order1's, Order2's and
Order3's and so on...) and build a table like below.

It seems Muenchean grouping gives the most elegant and generalizable solution. Try <xsl:key name="orders-by-name" match="orders/*" use="name()"/> <xsl:template match="Orders"> <xsl:for-each select="*[generate-id()=generate-id(key( 'orders-by-name',name())[1])]"> <p><xsl:value-of select="name()"/></p> <table> <tr> <xsl:for-each select="*"> <td><xsl:value-of select="name()"/></td> </xsl:for-each> </tr> <xsl:for-each select="key('orders-by-name',name())"> <tr> <xsl:for-each select="*"> <td><xsl:value-of select="."/></td> </xsl:for-each> </tr> </xsl:for-each> </table> </xsl:template> Untested, beware of small problems, it's in the midst of the night.

J.Pietschmann


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.