[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Select elements between others


Subject: RE: [xsl] Select elements between others
From: Jarno.Elovirta@xxxxxxxxx
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



Current Thread