RE: [xsl] Passing sort criteria as a paramter

> 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.

This suggests to me that we might want to provide some kind of local
namespace declaration within an XPath expression, analogous to XPointer's
"xmlns(x=http://example.com/foo) xpointer(//x:a)" or to the local namespace
declarations allowed by XQuery. Or indeed, that we might want to explicitly
require XSLT processors to support XPointer (they are already allowed to
support XPointer, in the form of a fragment identifier within the URI
Reference passed to the document() function).

Mike Kay

[1] http://www.w3.org/TR/2001/WD-xptr-20010108/#ns-context

Received on Monday, 28 January 2002 08:28:39 UTC