Re: [xsl] Identity Transform and Default Templates, I think...

Subject: Re: [xsl] Identity Transform and Default Templates, I think...
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Tue, 18 Jun 2002 22:34:06 +0200
Schneeman, Brent wrote:
That sheet works fine (using Xalan2-J). But now I'd like to make it a bit
more flexible. I want to be able to identically copy elements which are not
matched by any explicit template.

Try adding the canonical copy-through template <xsl:template select="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template>

BTW:
  <xsl:template match="BD">
    <!-- output Body element -->
    <Body>
      <!-- grab the id attribute -->
      <xsl:attribute name="id">
        <xsl:value-of select="attribute::id"/>
      </xsl:attribute>

You can write this as <xsl:template match="BD"> <!-- output Body element --> <Body id="{@id}">

(Look up "attribute value template" and shorthands
for XPath axes)

J.Pietschmann


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



Current Thread