|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Identity Transform
Abie,
At 04:28 PM 9/22/2003, you wrote: why does the standard identity transform use copy instead of copy-of? Since it proceeds down the tree step by step, it is a trivial matter to amend the identity transform with your own tree-tweaking logic: <xsl:template match="/ | @* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template><xsl:template match="broken">
<fixed>
<xsl:apply-templates select="@* | node()"/>
</fixed>
</xsl:template>Put these two together and you get a stylesheet which takes arbitrary input and returns it as the result -- except all <broken> elements, at any level, are now <fixed>. The copy-of method is, of course, more efficient if you actually need to clone a subtree, rather than copy-it-mostly-except, which is what most applications of an identity transform actually need to do. Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ====================================================================== XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








