This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Newbie question: copying almost all nodes in XSLT
- To: <xsl-list at mulberrytech dot com>
- Subject: Re: Newbie question: copying almost all nodes in XSLT
- From: "Nikolai Grigoriev" <grig at iitp dot ru>
- Date: Sun, 12 Mar 2000 16:03:23 +0300
- References: <3.0.6.32.20000312130743.007d21e0@mail.wineasy.se>
- Reply-To: xsl-list at mulberrytech dot com
Niklas Agevik wrote:
> After the first transformation i want it to just replace the count element
> but keep the rest of the page intact so that the result is like this:
>
> <root>
> <p id="1">
> This page has been visited <xsp:expr>count</xsp:expr> times!
> </p>
> </root>
Try to redefine the default rule to perform an identity transformation,
and then specify a specific rule with a higher priority to handle count
elements:
<!-- Default transformation - identity -->
<xsl:template match="*|@*|comment()|text()">
<xsl:copy>
<xsl:apply-templates select="*|@*|comment()|text()"/>
</xsl:copy>
</xsl:template>
<!-- Count -->
<xsl:template match="count" priority="1">
<xsp:expr>count</xsp:expr>
</xsl:template>
Regards,
Nikolai
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list