Question about the key function

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about the key function

Stefan Wachter
Hi all,

using the key function the third argument can be used to specify the
nodes that are indexed. Reading the XSLT specification
(http://www.w3.org/TR/xslt20/#keys) I am still unsure about the meaning
of the third argument. It seems that Saxon is using the third argument
as the root of the nodes to be indexed. For example if a node somewhere
in a document is specified only the descendant-or-self nodes of that
node are considered.

Can the key function be used to index partial document trees. Is this
correct? Then, why does the specification demand that the supplied third
argument must have a document node as an ancestor?

Regards,
--Stefan


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
Reply | Threaded
Open this post in threaded view
|

RE: Question about the key function

Michael Kay
> Can the key function be used to index partial document trees. Is this
> correct? Then, why does the specification demand that the
> supplied third argument must have a document node as an ancestor?

I think we were basically making assumptions about implementation
strategies, which may or may not prove to be correct. In adding the feature
to search within a subtree, we wanted to give users extra capability without
putting a lot of extra burden on implementors. We reckoned many products
might choose to build indexes at the document level even though only a
subtree is being searched.

Michael Kay





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help