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

Re: [xsl] XSLT compiler and syntax extensions


Subject: Re: [xsl] XSLT compiler and syntax extensions
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 17 Nov 2010 18:30:35 -0800

> It's an
> XSLT compiler, by which I mean a pure XSLT 1.0 stylesheet (using no
> extensions) that can take a stylesheet using certain XSLT 2.0 features
> (and some other extensions) and "compile" it into a pure XSLT 1.0
> stylesheet.  Both the compiler and its output should be able to run in
> any XSLT 1.0 compliant engine.
.  .  .  .  .  .  .  .  .  .  .
> So, the question is, would anyone here be interested in a tool like
> this?

Not really. The most valuable features of XPath 2.0 and XSLT 2.0 are
extremely difficult to implement in XPath 1.0/XSLT and without these
features it is meaningless to use a much weaker language. Why should I
be interested in a language lacking such features, just to name a few,
 as sequences, rich types and type checking, the enormous standard
function library, the convenient support for regular expressions, the
much higher composability of XPath expressions, ...

Also, such a project would add very little to the already available
EXSLT implementations.

Even the current XPath 2.0/XSLT 2.0 languages are already getting
"older" as XPath 3.0/XSLT 3.0 are about to appear.

We are on the verge of XSLT 2.0 being made available (compiled to
Javascript) to any of the five major browsers (see Michael Kay's
latest blog post on this topic). Given that this effort would be
successful, I don't see any compelling reasons for developers to
continue using XSLT 1.0



--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play


On Wed, Nov 17, 2010 at 4:45 PM, Brandon Ibach
<brandon.ibach@xxxxxxxxxxxxxxxxxxx> wrote:
> The recent mention of an XSLT optimizer reminded me of a project I've
> been working on, here and there, for the last year or two. B It's an
> XSLT compiler, by which I mean a pure XSLT 1.0 stylesheet (using no
> extensions) that can take a stylesheet using certain XSLT 2.0 features
> (and some other extensions) and "compile" it into a pure XSLT 1.0
> stylesheet. B Both the compiler and its output should be able to run in
> any XSLT 1.0 compliant engine.
>
> My motivation is twofold. B First, I think one of the reasons that XSLT
> 2.0 hasn't gained more momentum is that there are still plenty of
> environments where it just isn't an option, due to architectural
> choices, policies regarding software vendor choices, or other reasons.
> B Restrictive as these environments are, they may still be able to
> accommodate a tool that requires no installation of new components
> other than dropping an additional XSLT into the process to be run
> whenever there are stylesheet changes. B If this enables the use of at
> least some XSLT 2.0 (or newer!) features, additional momentum might be
> built to encourage other vendors to add XSLT 2.0 support to their
> engines.
>
> The second motivation is to have a platform on which to experiment
> with some types of extensions, so far mostly in the "syntax sugar"
> category. B For instance, I've experimented with an extension-element
> equivalent to XSLT 2.0's "stylesheet functions" and some enhancements
> to XSLT instructions such as, a very simple example, replacing the
> common XSLT 1.0 case of:
>
> B  B <xsl:if test="condition"><xsl:attribute name="att"><xsl:value-of
> select="concat('abc', value, 'def')"/></xsl:attribute></xsl:if>
>
> with (some of this is supported in XSLT 2.0 - some of it isn't, but
> maybe could be in XSLT 2.1/3.0?):
>
> B  B <ext:attribute test="condition" name="att" select="concat('abc',
> value, 'def')"/>
>
> or even:
>
> B  B <ext:attribute test="condition" name="att" value="abc{value}def"/>
>
> I've implemented a variety of other extensions, with plans for more,
> and have ideas for a variety of directions this tool could take.
>
> So, the question is, would anyone here be interested in a tool like
> this? B What types of features would you like to see it include? B If
> this were to be turned into an open project, would anyone be
> interested in collaborating on its further development? B I'm
> interested in any type of feedback, positive, negative or otherwise.
>
> -Brandon :)


Current Thread
Keywords