This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XSLT 1.1 comments
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] XSLT 1.1 comments
- From: "Steve Muench" <Steve dot Muench at oracle dot com>
- Date: Wed, 14 Feb 2001 19:52:53 -0800
- References: <200102150248.TAA14491@localhost.localdomain>
- Reply-To: xsl-list at lists dot mulberrytech dot com
| > 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