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

RE: xsl:function

Subject: RE: xsl:function
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Sat, 10 May 2003 16:59:42 +0100
xsl function in xslt
> 
> Just wanted to drop a note saying that the Saxon 7.5 
> implementation looks good. One thing that did occur to me -- 
> with the ability to specify data types now an intrinsic part 
> of the language, I wonder if the two functions
> 
>  <xsl:function name="ol:func">
>   <xsl:param name="arg1" as="xs:integer"/>
>   <h1>This is an integer</h1>
>  </xsl:function>
> 
>  <xsl:function name="ol:func">
>   <xsl:param name="arg1" as="xs:string"/>
>   <h1>This is a string</h1>
>  </xsl:function>
> 

As Jeni pointed out, the current XPath model doesn't allow two functions
with the same name and arity. In fact, the current Saxon implementation
doesn't yet allow two functions with the same name and *different*
arity.

In principle the XPath function calling rules could be extended to
handle polymorphic functions, but this would require some careful
consideration of the rules for (a) untyped data as arguments, and (b)
atomization (what if one function accepts a node, and the other an
integer?).

The XQuery people, however, are quite keen *not* to allow function
binding based on the dynamic types of the arguments. It makes it much
harder to do compile-time optimization, which is so important when
selecting efficient access paths in large databases.

Michael Kay


 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.