xsl-list
[Top] [All Lists]

Re: [xsl] XSLT compiler and syntax extensions

2010-11-17 22:30:37
I've implemented a variety of other extensions, with plans for more,
and have ideas for a variety of directions this tool could take.


Speaking of this "xsl:if+xsl:attribute" extension, I do not think it is very practical.

About XSLT 2.0 to XSLT 1.0 compiler:

a) It will not support all XSLT 2.0 functionality, because of obvious limitations in XSLT 1.0 b) Using it will make XSLT code difficult to debug. If you'll make an error, it will report line location distorted for all code that follows
<xsl:variable
  name="name"
  select="select"
  as="type" />

Generally, the best possible way to experiment w/ XSLT syntax sugar is to use URIResolver coupled w/ SAX ContentHandler.

For example, I am actively using my own syntax sugar extension that enables sort of modules via modes:
http://www.gerixsoft.com/blog/xslt/xsl-include-mode-new

Plus couple of experimental extensions:
1) Embedding XQuery directly into XSLT code:
        <xsl:template match="a">
                <aa>
                        <saxon:query>
                                <from-xquery>
                                {
                                        $current
                                }
                                </from-xquery>
                        </saxon:query>
                </aa>
        </xsl:template>

2) XSLT w/ XQuery like syntax:
<?xml version="1.0" encoding="utf-8"?>

<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:exsl="http://exslt.org/common"; xmlns:gml-prefix="xsl">

        output method="xml" omit-xml-declaration="no" indent="no" 
encoding="UTF-8";
        
        include href="link1.xsl";
        include href="link2.xsl";
        include href="link3.xsl";
        
        template match="/" {
            variable name="link1" {
                <aa>
                    apply-templates mode="link1" select="node()";
                </aa>     
            }
            variable name="link2" {
                <bb>
apply-templates mode="link2" select="exsl:node-set($link1)/node()";
                </bb>     
            }
            variable name="link3" {
                <cc>
apply-templates mode="link3" select="exsl:node-set($link2)/node()";
                </cc>     
            }
        
            copy-of select="exsl:node-set($link3)/node()";
        }

</xsl:transform>

This one looks pretty promising, but I am not currently using it because of lack of syntax highlighting.

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.


--~------------------------------------------------------------------
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>
--~--