Subject: Re: recursivly applying a transform to a result tree
From: tcn@xxxxxxxxxxxxx (Trevor Nash)
Date: Mon, 09 Apr 2001 12:59:06 GMT
|
>But this gives the next problem that if the input already has b/c it also
>will be transformed to <d />.
One mans problem is another mans solution ;-)
In one of my applications this is precisely the behaviour I want.
> This
>I solved by using mode="tree" in the <xml:apply templates select="$tree" />
>and the
><xsl:templates match="b/c">.
Yes, that is what I would do. This means that you can decide on a
case by case basis whether given templates may be composed or not. I
did not follow your proposal exactly, but I suspect it did not offer
this choice?
>It works, but I'm not really charmed about the solution. I also read
>something in the XSLT1.1 spec that the result tree fragments were going to
>be removed ? But I'm not sure (I'm not getting any response from
>w3c.org so I can't look it up). If they remove this feature, I hope they
>will add a slightly more elegant way to apply templates to result tree
>fragment.
They have not removed them exactly, they just removed the distinction
between RTF and node-set. This allows the pattern I described: before
you would have had to use an extension function such as
<xsl:apply-templates select="saxon:node-set($tree)"/>
Regards,
Trevor Nash
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|