Re: [xsl] XSLT 1.1 comments

Subject: Re: [xsl] XSLT 1.1 comments
From: "Steve Muench" <Steve.Muench@xxxxxxxxxx>
Date: Wed, 14 Feb 2001 19:52:53 -0800
| > The <xsl:script> element could just as well be called:
| > 
| > <xsl:associate-user-written-extension-function-implementation-with-namespace/>
| I don't understand.  Do you mean msxml:script?

I mean that the <xsl:script> element associates an
implementation of user written extension functions with
a given namespace, in a language-neutral way.

Today each existing processor that supports user-written
extension functions does this namespace-to-implementation
binding in a proprietary way. Some use extension elements,
some use funky recognize-something-in-the-namespace-uri

<xsl:script> provides a standard way of accomplishing the same
thing, and makes it much more clear that user-written extension
functions are being used in the current stylesheet.

Using the implementation I'm most familiar with, a concrete
example of this difference is the following:

Today, to use the java.util.Date class in a stylesheet
to retrieve the current date, in OracleXSLT I do 
something like this:

  <xsl:stylesheet version="1.0" xmlns:xsl="..."
    <xsl:template match="/">
      <xsl:value-of select="date:toString(date:new())"/>

The fact that this is a user-written extension function and the
fact that the language is java is totally buried in the uri.

With <xsl:script> this becomes:

  <xsl:stylesheet version="1.0" xmlns:xsl="..." xmlns:date="urn:date">

     | Fact that user-written extension functions are in use is 
     | much more clear, and done in a uniform way.
    <xsl:script implements-prefix="date" 

    <xsl:template match="/">
      <xsl:value-of select="date:toString(date:new())"/>

Steve Muench, Lead XML Evangelist & Consulting Product Manager
BC4J & XSQL Servlet Development Teams, Oracle Rep to XSL WG
Author "Building Oracle XML Applications", O'Reilly

 XSL-List info and archive:

Current Thread