Subject: Re: Building RTF variable
From: Peter Davis <pdavis152@xxxxxxxxx>
Date: Fri, 25 Oct 2002 10:41:48 -0700
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday 25 October 2002 00:47, Ragulf Pickaxe wrote:
> >"xxx:node-set($Test)/node[1]".
>
> But... is it then not possible to build a nodeset directly in the XSL? What
> is the difference between doing thus and the example that I had in the
> orriginal mail?
No, it's not currently possible with standard processors. The difference is
that you were creating a Result Tree Fragment (RTF), which is not the same as
a node-set.
All you can do with an RTF is <xsl:copy-of/> and <xsl:value-of/>. The idea is
(was) that you can create an RTF as the value of a variable and re-use it
throughout your stylesheet. For example, in HTML you might have some special
code to output a bullet point with pretty graphics, and you want to re-use
that code with the exact same <img> tag.
You cannot select children of an RTF. To do that, you have to convert it to a
node-set. Processor designers realized the pain of doing this, so they
provide xxx:node-set() functions to do the conversion. Unfortunately, the
functions are not compatible between processors, so you will have to do some
tricks if you want to use more than one processor.
> With the example I do not need any conversions between anything.
Well, go complain to the XSLT 1.0 designers :). XSLT 2.0 doesn't have this
problem, since so many people like yourself have complained.
I believe that Saxon 7.0 is the only browser that supports XSLT 2.0. You can
go try that, get RTF to node-set conversion, and a bunch of other new
features for free.
- --
Peter Davis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9uYJchDAgUT1yirARAjWNAJ4tJosh6Gu8Pjiq96JF1ZhmTQ0EPwCghuKW
ofFSnBSdfKZBb0GgoMqWd4Y=
=ck0v
-----END PGP SIGNATURE-----
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|