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

[xsl] suggestion: xsl:modified-copy

Subject: [xsl] suggestion: xsl:modified-copy
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Wed, 1 Aug 2012 11:07:35 +0100

It's a bit late for 3.0, but perhaps for 3.1... sometimes it would be
useful to have the ability to copy and modify a section of the input
at the point its copied, rather than using an additional moded
identity template and no-op templates.

For example given something like:


and you want to copy the lot to the result except <baz/> you could do:

<xsl:modified-copy select="foo">
  <xsl:except select="baz"/>

if you wanted to add another <baz/> you could do:

<xsl:modified-copy select="foo">
  <xsl:insert-after select="baz">

Just some thoughts....

Andrew Welch

Current Thread