RE: [xsl] insert to copied node

Subject: RE: [xsl] insert to copied node
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 19 Mar 2009 23:14:10 -0000
I think you're in overdrive. Pause to think before your next question.

xsl:copy-of can only be used when you want to make an exact copy. To make a
modified copy, the usual coding pattern is to do a recursive descent of the
tree, using the identity template as the default template, supplemented with
extra template rules for elements (your <test> element) that you want to
modify.

That's such a common coding pattern that most processors should handle it
efficiently.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Michalmas [mailto:michalmas@xxxxxxxxx] 
> Sent: 19 March 2009 23:07
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] insert to copied node
> 
> Hi guys,
> 
> I have some XML node, that i want to copy:
> <xsl:copy-of select="." />
> 
> Insert that element there is <test> node. Besides the copy, i 
> want to insert extra node to <test> node.
> 
> How can i do it efficiently (not by copying every node separately)?
> 
> Thanks!

Current Thread