RE: [xsl] XSLT 1.1 comments

Subject: RE: [xsl] XSLT 1.1 comments
From: "Kaganovich, Yevgeniy (Eugene)" <ykaganovich@xxxxxxxxxxx>
Date: Tue, 13 Feb 2001 00:54:31 -0800
I had a problem with the XSLT 1.0 extensions for the reasons you're stating.
I don't care if they're language dependent or not; they still make my
stylesheet incompatible with any other processor than the one for which the
functions are written. Once you start using saxon:evaluate, or ft:evaluate,
or whatever:evaluate, you already gave up on interoperability; whether you
stick the function inline in <xsl:script/> or link to it externally doesn't
make too much difference to me...

At least in 1.1, some processors can interopere. It's a shame that there is
a divide between different languages, but it's better than nothing.
<xsl:script/> doesn't help or hurt, it's always going to be up to the users
whether they want to write portable stylesheets or not.

: In fact, why can't XSLT implementors in Python, C++, VB, 
: Perl, Java and other  
: languages work together on this?
: 
: You want a portable saxon:evaluate?  Fine.  I do too.
: 
: 4XSLT has ft:evaluate.  Let's all talk about it and put 
: together a set of 
: extensions, one of which is *:evaluate.

I've been waiting for this for a long time...

I think there is a step missing between not having any standards for
extensions at all, and defining language-specific bindings. Let's start with
some set of requirements that can allow defining cross-language extension
libraries. Off the top of my head:

1) Extension functions can accept as parameters and return XSLT datatypes
(primitives, nodesets) or declared datatypes. 

2) Whether the function works correctly or not can be described either
algorithmically, or, if that's too hard, by a set of constraints and
examples. 

3) Non-XSLT datatypes must be declared using IDL.


In the following example, how hard can it be to define that ex:sysdate()
returns a #DATE object, which is declared to have add-days() method and can
be passed to ex:format-date() ?

<xsl:variable name="date" select="ex:sysdate()"/>
Tomorrow will be <xsl:value-of select="ex:format-date(ex:invoke($date,
'add-days', 1), 'DD-MM-YYYY')"/>


Once we have defined a formal way to describe extensions, then it makes
sense to define language-specific bindings, for the convenience of processor
implementors, not XSLT developers. I'm not an implementor (well, not
usually), I just want to use ex:evaluate() and distribute my stylesheet to
people without worrying what processor they will use on it. 

- Eugene

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread