[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: re-ordering nodes
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
|
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
|