xsl-list
[Top] [All Lists]

Re: [xsl] creating nodes using multiple templates/modes

2006-03-26 22:23:08
David Carlisle wrote:
I came up with the following XSLT 2.0 using Saxon 8.7.  This script
modifies a UML tree serialized as XMI

[...]

If you want to do a two stage transformation then that is possible in
xslt2 (which you are using) (in xslt1 it required the common node-set
extension function).

Just store the result of the first transform in a variable then apply
templates to that. This is logically tehsame as having two stylesheets
and writing out an intermediate result, but its usually more convenient
and efficient to do it in one stylesheet.

<xsl:variable name="x">
  <xsl:apply-templates mode="a"/>
</xsl:variable>
<xsl:apply-templates select="$x" mode="b"/>

But what if x is built using multiple XSLT templates and multiple XSLT
templates need to modify x (independently) in the second phase?

Do I need two scripts for that (one to build x, and one to modify x) ?

David

Regards,
Rene
-- 
GPG fingerprint = 6793 FA71 C4E8 3BAD 5954  9552 F3DA D315 B8DB 03F5
(subkeys.pgp.net)

"It won't fit on the line."
                -- me, 2001

--~------------------------------------------------------------------
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>
--~--