|
[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
|
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
|
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
| RSS 2.0 |
|
| Atom 0.3 |
|
|