This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27078 - [xslt3.0ts] xp-striding-grounded-motionlessA007 (namespace nodes)
Summary: [xslt3.0ts] xp-striding-grounded-motionlessA007 (namespace nodes)
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 Test Suite (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Abel Braaksma
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-16 15:00 UTC by Michael Kay
Modified: 2015-05-06 21:15 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2014-10-16 15:00:31 UTC
This test contains a number of paths starting with namespace-node(), that expect to be grounded and motionless. 

Some of them have incorrect results according to the spec, e.g.

namespace-node()/self::node() should be climbing and motionless.

Some of them have results where it perhaps the spec could do better, e.g.

namespace-node()/descendant-or-self::node() is roaming and free-ranging according to the spec, but with more careful analysis could be made climbing and motionless. (But is it worth it?)
Comment 1 Abel Braaksma 2014-10-16 15:21:09 UTC
> namespace-node()/self::node() should be climbing and motionless.

No I don't think so, because the rh-side returns the empty sequence (or do I misunderstand the principal node kind rule here?) and the rule says that in that case the result is grounded and motionless:

19.8.7.7
3. If the statically-inferred context item type is such that the axis will always be empty [...] then the sweep is motionless and the posture is grounded

> namespace-node()/descendant-or-self::node() is roaming and free-ranging 

Similar to above, unless, indeed, I have misunderstood the principal node kind rule.
Comment 2 Michael Kay 2014-10-16 15:26:34 UTC
The principal node kind rule only affects axis steps that use a NameTest, not those that use a KindTest. node() is a KindTest. So self::node selects the node whatever kind it is, whereas self::* selects it only if it is of the principal node kind.
Comment 3 Abel Braaksma 2014-10-16 15:27:58 UTC
Just checked how we did it, we indeed return a namespace on namespace-node()/self::node(). So, indeed, I misinterpreted the rules on principal node kind for these tests. I will update them.

I agree that I don't think it is worthwhile to optimized attribute()/descendant-or-self::node(), we already optimize attribute()/descendant::node() (empty sequence) and that seems to be good enough for me.
Comment 4 Abel Braaksma 2014-10-16 19:28:07 UTC
> namespace-node()/self::node() should be climbing and motionless.

This is a result of the current XP30 REC: the expression should throw an error. Quote:

<quote>
If the axis name is omitted from an axis step, the default axis is child, with two exceptions: if the NodeTest in an axis step contains an AttributeTest or SchemaAttributeTest then the default axis is attribute; if the NodeTest in an axis step is a NamespaceNodeTest then a static error is raised [err:XQST0134] .
</quote>

This was actually part of a bug I raised and most recently, a response from Jonathan told me that the WG is still figuring out how to fix it with an erratum.

The reason it has motionless + grounded is because if a step raises an error, it should be considered as motionless and grounded: errors are not part of the analysis.

> namespace-node()/descendant-or-self::node()

Same is true for this one, the first step is an error, result type of errors is the empty sequence, and the analysis should therefore consider the lh-side as an empty sequence, and the rh-side then doesn't matter anymore.

I have marked (but later forgot) this specific case in the _base-expressions.xml (in the tests/sandp dir) which forms the basis of the test generator, as follows:

<!-- if the static result type is an error, it is the empty sequence in posture/sweep analysis
     note: in XP31 the default axis for such test is the namespace axis, bug#26788 -->
<production node-type="error">namespace-node()</production>

I'm not sure what the best cause of action is here.
Comment 5 Abel Braaksma 2014-10-28 17:42:26 UTC
The WG accepted the resolution as mentioned in the Description of the bug entry and accepts that this will be the status quo even though an erratum is not yet published for XP30. See minutes of 2014-10-23 (member only).

Fixed in rev#764 in XT3 repository.
Comment 6 Abel Braaksma 2015-05-06 21:15:24 UTC
Was resolved > 30 days ago, closing.