Re: Designs for XSLT functions (Was: Re: [xsl] RE: syntax sugar for call-template)

Subject: Re: Designs for XSLT functions (Was: Re: [xsl] RE: syntax sugar for call-template)
From: Uche Ogbuji <uche.ogbuji@xxxxxxxxxxxxxxx>
Date: Tue, 20 Feb 2001 08:24:32 -0700
> Firstly, as we know, key() and id() are restricted to finding nodes in
> the current tree. If I want to use an extension function that
> retrieves keyed nodes in a particular document then I need to be able
> to do:
> 
> <exsl:function name="my:key">
>    <xsl:param name="key-name" />
>    <xsl:param name="key-value" />
>    <xsl:param name="file-name" />
>    <xsl:param name="base-node" select="/" />
>    <xsl:for-each select="document($file-name, $base-node)">
>       <exsl:result select="key($key-name, $key-value)" />
>    </xsl:for-each>
> </exsl:function>

I see the general gist here.  However, note that since XPath 1.0 doesn't have 
a general list type (which I think is near imperative for the next XPath) it 
could be quite a pain to validate the idea that "multiple exsl:result" 
elements are allowed as long as each evaluates to a node set".

I could do it in 4XSLT, but the implementation strategy I have in mind is 
probably not a general approach.

But if other implementors don't have a problem with it, I don't.


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@xxxxxxxxxxxxxxx               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread