Subject: RE: Select elements between others
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Tue, 20 Jan 2004 10:41:39 +0000
|
Thank you all, I didn't recognise it as a grouping problem, I was fixated on
the idea expressed by my post's subject.
Joe
From: Jarno.Elovirta@xxxxxxxxx
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: Select elements between others
Date: Tue, 20 Jan 2004 12:18:38 +0200
Hi,
> I want to turn this into a more normal form to make it easier
> to manage:
It's usually easier to help people if they show us what they have so far;
your's is a grouping problem, see
<http://www.jenitennison.com/xslt/grouping/>.
<xsl:template match="data">
<xsl:copy>
<xsl:apply-templates select="block"/>
</xsl:copy>
</xsl:template>
<xsl:template match="block">
<xsl:copy>
<xsl:apply-templates select="following-sibling::*[1]" mode="group"/>
</xsl:copy>
</xsl:template>
<xsl:template match="item" mode="group">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
<xsl:apply-templates select="following-sibling::*[1]" mode="group"/>
</xsl:template>
<xsl:template match="*" mode="group"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
Cheers,
Jarno - Wumpscut: Mother (Maternal Instinct)
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
_________________________________________________________________
Use MSN Messenger to send music and pics to your friends
http://www.msn.co.uk/messenger
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|