Subject: Re: [xsl] re-ordering nodes From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Thu, 20 Dec 2001 14:57:14 +0000 |
David, > Jeni> Perhaps you can make it clearer what you want the stylesheet > Jeni> to do. > > Jeni, I'm disapointed in you, you used to be able to reliably > determine the spec given no information at all, have you lost this > gift? Actually I was being lazy. I think that what Srini wanted was: <xsl:strip-space elements="*" /> <xsl:template match="list"> <xsl:apply-templates select=".//o"> <xsl:sort select="count(node())" data-type="number" /> </xsl:apply-templates> </xsl:template> <xsl:template match="o"> <o> <xsl:apply-templates select="a | b | text()" /> </o> </xsl:template> <xsl:template match="a | b"> <xsl:copy> <xsl:copy-of select="@*" /> <xsl:if test="o"> <xsl:comment> <xsl:text> for </xsl:text> <xsl:for-each select=".//o[not(o)]"> <xsl:value-of select="number()" /> <xsl:if test="position() != last()">, </xsl:if> </xsl:for-each> <xsl:text> </xsl:text> </xsl:comment> </xsl:if> </xsl:copy> </xsl:template> At least it gives the required output for the single sample document... Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] re-ordering nodes, David Carlisle | Thread | Re: [xsl] re-ordering nodes, Srinivasan Guruswami |
RE: [xsl] XPath problem, Sanjay Pandey/Towers | Date | RE: [xsl] xsl:variable question, Long Zhao |
Month |