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

Re: [xsl] deep copy without attributes

Subject: Re: [xsl] deep copy without attributes
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Tue, 21 May 2013 09:09:15 +0100

> I've not been paying attention to 3.0 but I'd be looking at copy-of
> and thinking it is ripe for accepting an anonymous function/template
> that is applied as it traverses it's hierarchy. which would be another
> way of addressing the issue.

...but that's already inbuilt into the language - template matching.
That's 'the xslt way' of solving this problem.

A deep copy (xsl:copy-of) copies the entire subtree unmodified, so
that would be the wrong approach if you want the output tree to be
different to the input tree... but I agree that the identity template
and shallow copying etc takes a bit of understanding.  But when the
penny does drop, the genius of it all becomes clear.

Andrew Welch

Current Thread