Re: [xsl] XSLT 2 processors

Subject: Re: [xsl] XSLT 2 processors
From: Liam R E Quin <liam@xxxxxx>
Date: Fri, 10 Feb 2012 06:55:51 +0100
On Thu, 2012-02-09 at 11:14 -0500, Wendell Piez wrote:

> Evan Lenz's work on the "Carrot" syntax for XSLT, which you possibly saw
> presented at Balisage, might give an interesting starting point for work
> on a compiler to write XQuery from XSLT 2.0. (Evan does go the other
> way, from XQuery+Carrot into XSLT.)

The hard part, I think (as Dr Kay has mentioned) is that XSLT has "match
patterns" and XQuery does not.  Interpreting XSLT in XQuery directly
might be hard as a result. Or at least not very efficient.

Preprocessing to convert might work.

I remember having a conversation with Jertme Simion abuot the idea of
making XPath expressions and node tests as first-class objects in
XQuery, e.g. so you could pass them to functions as arguments, ask what
they matched, etc.

As it stands, apply-templates might involve something like
    (for $pattern in find-candidates($match-patterns, $mode, $here)
    order by $pattern/@priority
    return if matches($here, $pattern[1]) then $pattern else ()
    )[1]
for each node you try to match. Hmm, well, it's 7am so maybe there's a
better way. If Dmitry thought about it for 30ms he'd probably find
one. :-)

Liam


--
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/

Current Thread