[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Select elements between others

Subject: RE: Select elements between others
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Tue, 20 Jan 2004 10:41:39 +0000
where between
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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.