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

RE: API for extension functions (was HTML forms with XSLT sl

Subject: RE: API for extension functions (was HTML forms with XSLT slideshow question)
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Mon, 27 Sep 1999 10:54:25 +0100
sl api
> > - how to provide context information (this has been my main reservation
in
> > adopting xt's style of interface: it's fine for "pure" 
> functions but doesn't
> > extend easily to functions that use context, e.g. the 
> current node or the system id of the containing stylesheet node.
> 
> Why can't you extend it by defining an interface along the lines of:
> 
> interface XPathContext {
>   Node getCurrentNode();
>   String getStylesheetSystemId();
>   ...
> }
> 
> ?
> 
> Then if the first argument of the Java function is of type 
> XPathContext,
> the XSLT processor will automatically pass the Java function an
> additional argument of type XPathContext representing the current
> context.
> 
That's certainly one possibility. Another (the one I was planning) is to say
that if the class containing the extension function implements Contextual,
then the method setContext(XPathContext) will be called before the function
itself is called.

Of course there's also a question as to exactly what context information
should be made available. It doesn't seem a particularly good idea, for
example, to provide access to the variable bindings. This relates to the
question of defining what side-effects are permissible.

Mike


 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.