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

Re: XSLT 1.1 comments

Subject: Re: XSLT 1.1 comments
From: "Steve Muench" <Steve.Muench@xxxxxxxxxx>
Date: Wed, 14 Feb 2001 19:52:53 -0800
xsl date tostring
| > 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
tricks.

<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="..."
    xmlns:date="http://www.oracle.com/XSL/Transform/Java/java.util.Date">
    <xsl:template match="/">
      <xsl:value-of select="date:toString(date:new())"/>
    </xsl:template>
  </xsl:stylesheet>

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" 
                              src="java:java.util.Date"/>

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

______________________________________________________________
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
http://www.oreilly.com/catalog/orxmlapp/



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


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.