RE: [xsl] reordering output (Again)

Subject: RE: [xsl] reordering output (Again)
From: "Chris Bayes" <chris@xxxxxxxxxxx>
Date: Mon, 22 Oct 2001 16:08:56 +0100
Eric,
You probably want to do something like
<xsl:template match="book">	
	<xsl:apply-templates select="para[not(@b)]" />
</xsl:template>
<xsl:template match="para">
	<xsl:choose>
		<xsl:when test="following::para[@b]">
			<xsl:copy-of select="." />
			<xsl:apply-templates
select="following::para[@b]">
				<xsl:sort select="@b" />
			</xsl:apply-templates>
		</xsl:when>
		<xsl:otherwise>
			<xsl:copy-of select="." />
		</xsl:otherwise>
	</xsl:choose>
</xsl:template>
<xsl:template match="para[@b]">
	<xsl:copy-of select="." />
</xsl:template>
But it depends on how complex you mean by complex.

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Eric Smith
> Sent: 22 October 2001 13:42
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] reordering output (Again)
> 
> 
> I asked the question in a previous mail to this list but 
> received no reponse.
> 
> In short, perhaps someone may advise:
> Is reordering of nodes in the output possible?
> 
> Many thanks
> 
> -- 
> Eric Smith - currently xalan and fop on linux
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread