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

Re: XSLT compiler and syntax extensions

Subject: Re: XSLT compiler and syntax extensions
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Thu, 18 Nov 2010 09:44:26 +0000
Re:  XSLT compiler and syntax extensions
My advice would be to keep the two projects separate.

An XSLT 2.0 processor written in XSLT 1.0 could be a very attractive product. It needs to be close to 100% conformant to XSLT 2.0 to get adoption, and this will not be easy to achieve. You might be able to use Javascript extensions if you can find a way to make them work cross-browser. Implementing the XSLT 2.0 data model on top of the 1.0 model is the main challenge. I can see how one would implement any atomic sequence as a string, for example, but it's less easy to see how to implement a sequence containing both nodes and atomic values, or a node-sequence that contains duplicate nodes. Perhaps you would have to represent such sequences using the generate-id() value of the node, dereferencing the IDs using keys.

As for XSLT extensions, there's masses of scope using a pre-processor; the challenge is to make your extensions powerful and attractive enough that people adopt them and start using then in preference to the "standard" primitives underneath.

Michael Kay
Saxonica


On 18/11/2010 00:45, Brandon Ibach 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.  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.

My motivation is twofold.  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.
  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.  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.  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:

     <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?):

     <ext:attribute test="condition" name="att" select="concat('abc',
value, 'def')"/>

or even:

<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?  What types of features would you like to see it include?  If
this were to be turned into an open project, would anyone be
interested in collaborating on its further development?  I'm
interested in any type of feedback, positive, negative or otherwise.

-Brandon :)

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.