[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Saxon versus Xalan implementations of evaluate()

Subject: RE: Saxon versus Xalan implementations of evaluate() extension function?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 7 Jul 2005 21:02:07 +0100
saxon vs xalan
Saxon 8.x does too much optimization to be able to guarantee that variables
declared in the stylesheet actually exist as such at run-time (for example,
variables that are never referenced are ignored completely). So I decided to
disallow direct access to variables in saxon:evaluate(). Instead, you can
pass parameters $p1..p9 to the query, e.g.

saxon:evaluate("$p1 + 3", $x)

returns 5 if $x is initialized to 2.

Micahel Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Andrzej Taramina [mailto:andrzej@xxxxxxxxxxx] 
> Sent: 07 July 2005 16:27
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Cc: mike@xxxxxxxxxxxx
> Subject: Re: Saxon versus Xalan implementations of evaluate() 
> extension function?
> 
> Adrian suggests:
> 
> > I think just doing all evaluations in a variable
> > beforehand should give you a bit more safety to work
> > in saxon/xalan/both. I was using xalan with the dyn
> > EXSLT extension and saxon and it seemed to work...
> > Although when I wanted to make it processor
> > independant to check beforehand what evaluate to use
> > like so... <xsl:apply-templates
> > use-when="function-available(dyn:evaluate)"
> > select="dyn:evaluate($evalThis)"/>, xalan 1.0
> > processor seemed to have a problem with the use-when
> > if this is an issue to work in both. I wasnt sure of a
> > workaround).
> 
> Is dyn:evaluate() availabe in Saxon 8.4? How about Saxon 6.5.4?
> 
> > but back to the problem, does this work?...
> > <xsl:variable name="evalThis" select="concat(
> > '$data/', @xpathValue )" />
> > ... saxon:evaluate( $evalThis )
> > 
> > at worst try this...
> > <xsl:variable name="evalThis" select="concat( $data,
> > '/', @xpathValue )" />
> > ... saxon:evaluate( $evalThis )
> 
> Won't work, since many times the variable $data is a node 
> set.  Xalan handles that fine.
> saxon:evaluate won't bind to the variable.
> 
> I tried reverting to Saxon 6.5.4 but then kept getting the 
> following exception:
> 
> javax.xml.transform.TransformerException: Error in expression 
> : Unexpected token EOF in
> expression
> 
> Anyone know what causes this exception and why Saxon 6.5.4 
> would throw this when Saxon 8.4
> and Xalan don't, on the same stylesheet source?
> 
> Thanks!
> 
> ....Andrzej
> 
> Chaeron Corporation
> http://www.chaeron.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.