This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: reordering output (Again)


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@lists.mulberrytech.com 
> [mailto:owner-xsl-list@lists.mulberrytech.com] On Behalf Of Eric Smith
> Sent: 22 October 2001 13:42
> To: xsl-list@lists.mulberrytech.com
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]