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/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--