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: Default rule for passing matched elements thru unchanged?


Brad Cox wrote:
> I'm baffled by how to build an xslt stylesheet that recognizes 
> specified elements while passing those not specified through 
> unchanged.

All you need to do is learn to use xsl:copy.

The identity transformation (a recursive copy of the source tree to the result
tree) is in the XSLT spec itself. Section 7.5, "Copying"

<xsl:template match="@*|node()">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
</xsl:template>

Add to this your templates to do special things with your special nodes, and
make sure they end with an xsl:apply-templates so that the children get
processed.

   - Mike
____________________________________________________________________________
  mike j. brown, fourthought.com  |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  personal: http://hyperreal.org/~mike/

 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]