xsl-list
[Top] [All Lists]

[xsl] suggestion: xsl:modified-copy

2012-08-01 06:08:09
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:

<foo>
  <bar/>
  <baz/>
</foo>

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

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

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

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

Just some thoughts....


-- 
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>