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

RE: [xsl] Annoying XSLT code


Subject: RE: [xsl] Annoying XSLT code
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 18 Aug 2005 22:16:19 +0100

> > Both XSLT and XQuery allow you to generate code; neither of 
> them (without
> > extensions) allow you to execute the code that you have generated.
> 
> It depends on the definition of "code" and "execute".
> 
> Using FXSL higher-order functions one can have a function return
> another function that exist statically or is dynamically created.
> 
> Of course, this is possible only in XSLT -- not in XQuery.

Yes, but I think the discussion was about xx:evaluate() - constructing
expressions from strings. Many XSLT and XQuery processors offer this as an
extension. It's true that in many cases - but not all - higher order
functions are an alternative solution to the problem. However, I've seen
quite a few applications where it's useful to hold XPath expressions in an
XML configuration file (or even allow users to enter them in a form) and
then evaluate them dynamically. In the applications I've come across,
support for XPath here is quite sufficient.

Generating stylesheets tends to have a rather different kind of use case:
typically there is some kind of specialized high level transformation
language with a small number of powerful constructs, which then gets
translated into XSLT for execution.

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


Current Thread
Keywords