[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Uncontrolled navigation around a document using @* ... huh?


Subject: Re: [xsl] Uncontrolled navigation around a document using @* ... huh?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Thu, 14 Nov 2013 10:58:15 +0000

We have in fact dropped this function in the latest internal draft, but I can
try and explain the problem it was trying to solve.

Suppose you have a user-defined function that converts strings to upper-case,
and then you call it as

f:convert(@code)

Now, the streamability analysis doesn't know what f:convert() does. It might
not have access to the code of the function, or the code might be overridden
subsequently in another package. So there's the possibility that
f:convert(@code) might do something like

count($param/root(.)//*)

in other words, it might navigate all over the document containing the node
that was supplied, which clearly wouldn't be streamable. But of course what
the function actually does, which is to atomize the attribute and process its
string value, is perfectly streamable, it's just that the analyser doesn't
know that.

What we are saying in the latest draft is that f:convert(@code) is streamable
provided the function signature of f:convert() declares its argument with an
atomic type. If it doesn't declare the type, streaming fails. This interacts
with the rules for packages, which say that when you override a function in
another package, the signature must be compatible.

Michael Kay
Saxonica


On 14 Nov 2013, at 10:27, Costello, Roger L. <costello@xxxxxxxxx> wrote:

> Hi Folks,
>
> The XSLT 3.0 specification introduces a new function for obtaining the
attributes on a node, fn:attributes.
>
> fn:attributes has some desirable properties that @* does not have:
>
> 	Unlike the attribute axis, @*, the
> 	fn:attributes function returns atomized
> 	attribute values, which cannot be
> 	used as the base for uncontrolled
> 	navigation around the document.
>
> Huh?
>
> What does that mean? How does @* enable "uncontrolled navigation around the
document." What does that mean? Would you provide an example to illustrate
this "uncontrolled navigation" please?
>
> /Roger


Current Thread
Keywords