|
Subject: Re: [xsl] Identity Transform and Default Templates, I think... From: "J.Pietschmann" <j3322ptm@xxxxxxxx> Date: Tue, 18 Jun 2002 22:34:06 +0200 |
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>
<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)
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Identity Transform and Defaul, Schneeman, Brent | Thread | Re: [xsl] Identity Transform and De, David Carlisle |
| [xsl] testing child elements for te, CROFT, MICHAEL | Date | Re: [xsl] Identity Transform and De, David Carlisle |
| Month |