[Bug 16184] [FO30] fn:path() should support fragments as well as documents


--- Comment #4 from Michael Kay <mike@saxonica.com> 2012-03-28 20:59:13 UTC ---

> As far as I understand your proposal, the function would return "./foo/bar".
> This would work if the path is evaluated on the $fragment variable, but in my
> example the template or function doesn't know about this variable.
> Returning "root()/foo/var" would be an option, except that root() being a
> function you couldn't use that to generate XSLT templates and my preference
> would be that the fn:path function returns
> "ancestor-or-self::node())[1]/foo/bar".

In your example there should be no "/foo" step, since the foo element is not a
child of anything.

I think I can see why you want a path that works regardless where in the tree
you are currently positioned, rather than requiring you to be positioned at the
root. But I don't understand why ((ancestor-or-self::node())[1] is preferable
to root().

Neither of these works as an XSLT pattern. If we want to generate something
that works both (a) as a pattern that selects the original node, and only the
original node (which is a use case I hadn't thought of), and (b) as a path
expresion that selects the original node, and only the original node, starting
from an origin anywhere within the tree, then it would have to be something
rather clumsy. Perhaps the cleanest would be for us to allow root() at the
start of a pattern, and then generate root()[self::foo]/bar[1].

Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 28 March 2012 20:59:17 UTC