This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Future XSLT expansion.
- To: <xsl-list at mulberrytech dot com>
- Subject: Re: Future XSLT expansion.
- From: "Jon Smirl" <jonsmirl at mediaone dot net>
- Date: Sat, 18 Mar 2000 16:43:47 -0500
- References: <NBBBJPGDLPIHJGEHAKBAIEIAFBAA.martind@netfolder.com>
- Reply-To: xsl-list at mulberrytech dot com
From: "Didier PH Martin" <martind@netfolder.com>
> So, always if I understood the text well (we are never sure with specs
:-))
> and if my lawyer says that we have jurisprudence here :-)) then, it seems
> that yes a variable element can contain structured content and not only
> strings.
Variables have always been able to contain structured content. The problem
is not with the variable definition it's with the <xsl:apply-template
select="$variable"/>. In my case the variable contains a result set fragment
and it's not legal to implicitly convert a result set fragment into a
node-set. I would need this: <xsl:apply-template
select="node-set($variable)"/>. Allowing this in the core would break the no
side effect rule.
> But I may be wrong and it is better if somebody else would check and
double
> check the specs to bring some more light. So that we can update our FAQ
> and conformance tests.
A while ago I exchanged direct email with James Clark that indicated that it
is indeed not legal to convert the contents of a variable into a node-set.
His response was that's what document('') is for. I did find this to be
non-obvious but it does work and XT is correct.
> "Variables introduce an additional data-type into the expression language.
> This additional data type is called result tree fragment. A variable may
be
> bound to a result tree fragment instead of one of the four basic XPath
> data-types (string, number, boolean, node-set). A result tree fragment
In another conversation we determined that there is a fifth XPath data type.
It's is an opaque variable datatype. Check the source of XT and you'll find
five datatypes. For example you can use extension functions to select a Java
class instance into an XSL variable. XSL can do nothing with the contents of
the variable except to pass it back to an extension function. I use this
feature to compute running totals efficiently.
Jon Smirl
jonsmirl@mediaone.net
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list