|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Infinte nesting with sorting
Hello to all
I've got a XML file like this:
<Issue id="2"
<Chapter id="2">
<Chapter id="1">
<Chapter id="2">
<Chapter id="2" />
<Chapter id="1" />
</Chapter>
</Chapter>
</Chapter>
<Chapter id="1">
<Issue id="1">
................
I want the output indented and sorted by chapter id, just like
<Issue 1>
<Issue 2>
<Chapter 1>
<Chapter 2>
<Chapter 1>
<Chapter 2>
<Chapter 1>
<Chapter 2>
.....
I've tried with the following XSL, that goes well with the indenting and
sorting the issues
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:apply-templates select="//Issue" order-by="+@id"/>
<xsl:apply-templates select="//Chapter" />
</xsl:template>
<xsl:template match="Issue"><p>
<xsl:value-of select="@id" />
<xsl:apply-templates /></p>
</xsl:template>
<xsl:template match="Chapter">
<BLOCKQUOTE>
<xsl:value-of select="@id" />
<xsl:apply-templates />
</BLOCKQUOTE>
</xsl:template>
</xsl:stylesheet>
But sorting the chapters looks painful, does anyone have a clue?
By the way, I'm using IE5, so I can't use <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Thanks to all
Oscar Rueda
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








