[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: How to output partial elements?
From: "Marrow" <marrow@xxxxxxxxxxxxxx>
Date: Tue, 20 Aug 2002 10:55:34 +0100
Hi Jem,

Something like?...

== XSL ==================================
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="kPreceding-normal" match="record[@type != 'normal']"
use="generate-id(preceding-sibling::record[@type='normal'][1])"/>

<xsl:template match="/">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="*">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

<xsl:template match="record[@type='normal']">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:copy-of select="node()|key('kPreceding-normal',generate-id())/node()"/>
  </xsl:copy>
</xsl:template>

<xsl:template match="record[@type!='normal']"/>
</xsl:stylesheet>
== end of XSL =============================

Hope this helps
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator




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


Current Thread
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member