Re: [xsl] Passing sort criteria as a paramter

Michael Kay wrote:
> > Michael Kay wrote:
> > > for example, how
> > > should namespace prefixes in the dynamic XPath expression
> > be resolved?
> >
> > Actually, this requirement already exists for several
> > xslt-functions. For
> > example the key() function has to resolve the prefix in the
> > keyname, and the
> > element-available function has to resolve the prefix of the
> > element-name.
>
> Yes; these functions require namespace context to be available at
run-time.
>
> But one of the use-cases for evaluate() is handling of XPath expressions
> that are read from the source document; and it's not clear that this
> requirement can be adequately met by using the namespace declarations that
> are in scope in the stylesheet, since these will not generally be known to
> the author of the source document containing the XPath expression.

Why not use a similar solution as the document() function (which i must say
is one of the most ingenious parts of XSLT1.0), where you can use a nodeset
as first argument and thus use the nodes in that nodeset as resolver, or
give a second argument to use as resolve node. Of course evaluate() would
only use the first node in the nodeset in the first argument, but that is
what would happen even if just a string was accepted as first argument.

/ Jonas Sicking

Received on Monday, 28 January 2002 08:47:50 UTC