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

Re: Designs for XSLT functions (Was: Re: RE: syntax su

Subject: Re: Designs for XSLT functions (Was: Re: RE: syntax sugar for call-template)
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Mon, 19 Feb 2001 21:26:35 -0800 (PST)
xsl return
Hi Jeni,

Jeni Tennison wrote:
> 
> Hello everyone,
> 
> 1. Declaring Functions
> ----------------------
> 
> 1.a. Using xsl:template vs. using exsl:function
> 

<xsl:function name="QName" p1="p1Name p1Default"
                          ....................
                          pN="pNName pNDefault"
                                                  >

    <!-- Contents here -->

</xsl:function>   

> 
> ---
> 
> 1.b. Top-level declaration vs. declaration within xsl:script
> 

Doesn't matter. <xsl:script> implies that the contents is script (alien to XSLT). 
Therfore, not placing <xsl:function> within <xsl:script> may help avoid confusion.


> ---
> 
> 1.c. exsl:return and/or result tree fragments
> 

  <xsl:return>

But this does not exclude returning RTF. There would not be a RTF type in XSLT 1.1. 
It will be more correct to speak about "dynamically created nodes".

Any variable that contains "dynamically created nodes" could be returned 
by <xsl:return>.
Therefore, question 1.c is misleading -- there will be no limitation on returning 
"dynamically created nodes" even only if <xsl:return> is allowed.

> 
> 2. Calling Functions
> --------------------
> 
> 2.a. exsl:function() vs. my:func()
> 

None of these.

Just:

fn()

I think fn() must be a standard XSLT/XPath function -- these functions do not have 
a full QName.

> 
> ---
> 
> 2.b. Passing parameters by position vs. name
> 

fn(QName, p1="Name1 Value1",..., pN="NameN ValueN")

This allows parameters to be passed by name (as above), 

by position:

fn(QName, p1="Value1",..., pN="ValueN")

or even in a mixed fashion:

fn(QName, p1="Value1", p2="Value2", p3="Name3 Value3",..., pN="NameN ValueN")

Here the first two parameters are passed positionally, the rest are passed by name.


This syntax is by far the most intuitive and easy to remember. 
It is also the most brief and flexible.

Cheers,
Dimitre Novatchev.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

 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.