xsl-list
[Top] [All Lists]

Re: XSLT pass through

2006-02-20 23:54:35
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(_at_)nascencetech(_dot_)com 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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>