[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] The evaluate function


Subject: Re: [xsl] The evaluate function
From: Trevor Nash <tcn@xxxxxxxxxxxxx>
Date: Thu, 03 Jan 2002 18:47:38 +0000

Hi Jeni,
On Thu, 3 Jan 2002 15:32:47 +0000, you wrote:

>Just to check that I'm following you correctly. You're saying that
>because the string passed to the evaluate() function could contain
>anything, the processor can't know whether it contains a reference to
>the $x variable in which the $x variable is treated as a node set, and
>therefore cannot optimise the storage of the $x variable.
>
Yes, thats it.

>In other words, the processor no longer has the opportunity to scan
>for uses of $x to work out what kind of value it is.
>
>I can see that's a problem. But couldn't the user could help the
>processor here by making the type of $x (and other global variables)
>explicit:
>
><xsl:variable name="x" type="xs:string">

Bear in mind its an example of a class of problems, offered in support
of Mike's comment about trying to obtain as much information as
possible statically.  Individually all these problems are soluble, of
course - but you have to think about how complex you make the
language.

>The possible performance hit is, in my opinion, not enough of a reason
>to omit a facility that makes the impossible possible.
>
Nothing is impossible ;-)

I also care about reliability.  If the compiler doesn't see half the
source code, it will also miss half the errors.  Some of which we'll
see on this list ;-((

I do worry that 'eval' could create more problems than it solves.  To
quote another message today:

>                    <xsl:value-of select="concat('/result/row[1]/column[', position(),']/@name')"/>                             

Could be the next disable-output-escaping!

Regards,
Trevor
--
Traditional training & distance learning,
Consultancy by email

Melvaig Software Engineering Limited
voice:     +44 (0) 1445 771 271 
email:     tcn@xxxxxxxxxxxxx

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread