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]
Other format: [Raw text]

Re: How to output partial elements?


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


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