Re: [xsl] Re: How to duplicate an entire subtree

Subject: Re: [xsl] Re: How to duplicate an entire subtree
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 29 Dec 2008 09:32:25 -0500
At 2008-12-29 10:30 +0100, nick public wrote:
I believe understood.
I'm using the xsl:copy that copy just the text values and not the
structure. In fact, if I wrap the xsl:copy in a new element, in the
result tree I have the new element and, inside, the text values of
source elements. The xsl:copy is using the XSLT built-in template.

Not quite ... the definition of <xsl:copy> is only to add the current node to the result tree. <xsl:copy> says nothing about descendent text values. In your stylesheet you had <xsl:apply-templates> where the nodes being pushed at your stylesheet were being handled by the built-in template rules. It is the effect of the built-in template rules that added the text value to the result tree, not the effect of <xsl:copy/>

Instead, xsl:copy-of uses a own template that consist of to keep the
copied structure.

Not a template, the instruction is just defined as copying the nodes.

I hope this helps.

. . . . . . . . . . . . . Ken

Upcoming XSLT/XSL-FO, UBL and code list hands-on training classes:
:  Sydney, AU 2009-01/02; Brussels, BE 2009-03; Prague, CZ 2009-03
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video sample lesson:
Video course overview:
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.
Male Cancer Awareness Nov'07
Legal business disclaimers:

Current Thread