Re: [xsl] Compatablity - MSXML and EXSLT

Subject: Re: [xsl] Compatablity - MSXML and EXSLT
From: Mike Brown <mike@xxxxxxxx>
Date: Fri, 21 Mar 2003 14:02:53 -0700 (MST)
bix xslt wrote:
> This may be the wrong place to be asking this question, but I was wondering 
> how I might enable the exslt functions within my msxml processor?

MSXML does not have native support for EXSLT.

However, at the exslt.org site, you will find that some of the functions have
been implemented in the form of code libraries that you can use in your
stylesheets. Some are pure XSLT templates, while others use MSXML-specific
features such as msxsl:script in conjunction with JavaScript.

For example, look at

  http://www.exslt.org/date/functions/date-time/index.html

or the more detailed

  http://www.exslt.org/date/functions/date-time/date.date-time.html.

Under "implementations" are links to date.js and date.msxsl.xsl. I'm not sure
how you would use date.js, but the other should just be a matter of putting
<xsl:import href="date.msxsl.xsl"/> in your stylesheet. Then you should be
able to use date:date-time(). Of course, it's not as efficient as a native
implementation would be, and not all of EXSLT is supported in this way.

> Perhaps a second question would be are there techniques used to identify 
> which processor you are currently utilizing?  If so, what?

XSLT 1.0 requires that all processors support
xsl:system-property('vendor').
This won't give you much to go on, but it's better than nothing.

> Currently, I've been debugging my scripts using instant saxon 
> (unfortunately, I'm unable to update my java language past 1.2), and then 
> reworking the xsl files for msxml.  In addition, I am unable to update my 
> browser (IE 5.0) at this time.
>
> Fortunately, I know that my end user will be working from their own hard 
> drive, and not via a web server, so I have a little more freedom with how I 
> choose to setup my xslt environment.

The MSXML support I described above requires MSXML3, because you need that in
order to support XSLT 1.0. You can install it from within IE5, in a manner
that either causes IE5 to use it by default (replace mode) or not
(side-by-side). Américo Albuquerque demonstrated a technique for doing this
automatically in this post:
http://www.biglist.com/lists/xsl-list/archives/200212/msg00606.html
and the msdn.microsoft.com has many, many docs for all versions of MSXML.

> That said, I'd really like to be able to make my xslt files compatable 
> across xslt processors.  Does anyone know what tools/techniques are 
> available to make this type of work easier?

Stick to your guns and only use XSLT 1.0. MSXML2, as comes with IE5, is not an
XSLT processor at all. It only supports a subset of the Dec 1998 working draft
of what was called XSL. This language was never meant to be so widely
deployed, and it was obsolete within 4 months. Companies that insist on
building their software around unstable technologies that were obsolete from
the outset deserve to fail, IMHO. Nevertheless, it sounds like you've at least
got enough control that you can do like Américo did and gently force people to
upgrade MSXML without abandoning IE5.

Mike

-- 
  Mike J. Brown   |  http://skew.org/~mike/resume/
  Denver, CO, USA |  http://skew.org/xml/

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


Current Thread