[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] XSLT pass through


Subject: Re: [xsl] XSLT pass through
From: Evan Lenz <evan@xxxxxxxxxxxx>
Date: Mon, 20 Feb 2006 22:54:35 -0800

Hi Wong,

You'd use a modified identity transform.

First, you'd have the identity transform rule:

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

Then, you'd override it for nodes that you want to treat differently:

 <xsl:template match="targetNS:goodbye">
   <!-- do something different -->
 </xsl:template>

See this page on the XSLT FAQ for further discussion:
http://www.dpawson.co.uk/xsl/sect2/identity.html

Hope this helps,

Evan Lenz
http://xmlportfolio.com
http://evanlenz.net/blog/


publicreg@xxxxxxxxxxxxxxxx wrote:
Hi,

Assuming a XML document like this:

<myRoot xmlns:targetNS="http://myNS.com">
<hello><targetNS:goodbye>123</targetNS:goodbye></hello>
</myRoot>

How would I get an XSLT result that reproduces all tags that are not of
namespace "targetNS" exactly as it was input? I only want to manipulate
the elements that are of namespace "targetNS", all the rest are to be
reproduced as-is.

Thank you!
Wong


Current Thread
Keywords