xsl-list
[Top] [All Lists]

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

2013-11-14 04:58:31
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(_at_)mitre(_dot_)org> 
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--