Re: [xsl] replacing nodes during xsl:copy-of

Subject: Re: [xsl] replacing nodes during xsl:copy-of
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Thu, 6 Jan 2011 14:15:52 +0000
> From a high-level, non-technical, viewpoint, what I need to do is convert
the XML to HTML  and either during the process, or after replace everything in
the <replace> elements with something else.

Ok this is your starting point - its an "identity transform" which
copies the input to the output node by node.  The more specific
template which matches the "replace" element takes precedence over the
"identity template":

<xsl:stylesheet version="2.0"

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

<xsl:template match="replace">
  [ something else ]


If you run that transform on this input:

<foo>hello <replace>world</replace></foo>

you get this output:

  [ whatever ]

Andrew Welch

Current Thread