Subject: Re: [xsl] sorting in <xsl:apply-templates> From: Mukul Gandhi <mukulgw3@xxxxxxxxx> Date: Wed, 10 Dec 2003 19:38:55 -0800 (PST) |
I guess, you wish to sort by Attribute seq ;) Below is the XSL, which does this ;) <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="chapters"> <xsl:for-each select="chapter"> <xsl:sort select="@seq" data-type="number" /> <document source="{@uri}" bookmark="{@title}"/> </xsl:for-each> </xsl:template> </xsl:stylesheet> Regards, Mukul --- Fred Wells <Fred.Wells@xxxxxxxxxxxxxxxx> wrote: > hello all, > Coming to the realization I don't understand > <xsl:apply-templates> at > all. > > here's my xml: > <chapters> > <chapter title="Pop Music" seq="1" pages="1-20" > uri="0-534-59368-7_09"/> <chapter title="Regarding > 'The White > Visitation'" seq="2" pages="21-31" > uri="0-534-82354-7_15"/> > <chapter title="Picking Your Fights Carefully" > seq="4" > pages="76-93" uri="0-843-71963-7_03"/> > <chapter title="Philosophy and Religion" seq="3" > pages="32-75" > uri="0-984-59754-7_02"/> > <chapter title="Publishing Issues" seq="5" > pages="94-104" > uri="0-534-59368-7_13"/> > <chapter title="Harvesting Honey for Profit" > seq="6" > pages="105-183" uri="0-454-99999-7_19"/> > </chapters> > > here's the snippets of my xsl that are problematic: > > <assemblePDF> > <xsl:apply-templates mode="assemble"> > <xsl:sort data-type="number" > select="@seq"/> > </xsl:apply-templates> > </assemblePDF> > > <xsl:template match="//chapter" mode="assemble"> > <document source="{@uri}" bookmark="{@title}"/> > </xsl:template> > > Now it's my understanding that this should bring > back a nodelist and > that within the 'apply-templates' I should be able > to sort that > nodelist. However no sorting is happening, I've gone > through some > diffrent variations on this with no success. Am I > looking at this way > too simply? Thanks. > > -fw > > Frederick Wells > Capps Digital > 35 W Wacker > 30th Fl. > Chicago, IL > 312.220.3056 > www.cappsdigital.com > > XSL-List info and archive: > http://www.mulberrytech.com/xsl/xsl-list > __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] sorting in <xsl:apply-tem, David Carlisle | Thread | Re: [xsl] traversing node by node i, ARULRAJ |
Re: [xsl] how to estimate speed of , Kevin Jones | Date | [xsl] group elements, Peter_Ivan |
Month |