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

Re: Function arguments (was regexps once)

Subject: Re: Function arguments (was regexps once)
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Mon, 14 Jan 2002 16:15:15 -0500
Re:  Function arguments (was regexps once)
Jeni,

[I wrote]
> > This suggests either a different keyword for functions that may
> > depend on the current context vs those that may not, or never
> > allowing functions to implicitly depend on the current context (and
> > thus function that wanted to do so would have to be written like
> > Jeni's second example, with
> >
> > <xsl:call-id select="my:resolve-uri($url, $node)" />
> >
> > ).
> >
> > For example, you could have xsl:function and
> > xsl:function-context-rel. Still, there could be trouble if a
> > function that was expected to be context-independent were to invoke
> > a context-dependent function as part of its definition. That would
> > have to be disallowed.
>
> I think that rather than disallowing calls to particular functions,
> you could make there be a difference between how the focus is set up
> for xsl:function-context-rel (where it's the same as the focus at the
> point when the function is called) and xsl:function (where it's
> something else, possibly the document node of the principal source
> document, as I discussed in an earlier mail to Joerg).
>
> An alternative to two elements, would be a "uses-context-from-call"
> flag on the xsl:function that is explicitly set to "false" if the
> function doesn't use anything about the context of the call.
>

Yes, I thought of using a flag, and I decided against it because you
wouldn't easily see it if you used included or imported function
definitions.  So it would be easy to assume an incorrect value for the flag
(or more likely, forget that there was a flag to pay attention to).  In
other words, a flag would be more error-prone than using a different
keyword.

> Assuming, of course, that some functions should be written with
> implicit information about the focus, which could be argued both ways.
>

Yes, definitely, assuming that...  which I'm not yet convinced would be such
a good idea...

Cheers,

Tom P


 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.