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 2416 - position-2 wrong (expected to fail but doesn't)
Summary: position-2 wrong (expected to fail but doesn't)
Status: CLOSED FIXED
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 0.7.0
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Carmelo Montanez
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-25 16:14 UTC by Martin Probst
Modified: 2005-10-26 15:18 UTC (History)
0 users

See Also:


Attachments

Description Martin Probst 2005-10-25 16:14:32 UTC
position-2 is set to be a failing test (FONC0001), and the query is this:

employee[position() = 1]

Which seems to be legal? At least the XQuery spec says that any step like E1[E2]
defines the context item for E2:
http://www.w3.org/TR/xquery/#eval_context
Comment 1 Alberto Massari 2005-10-25 20:35:35 UTC
I too find that the query is wrong, but because it expects the wrong error.
It expects that position() detects that there is no context item (FONC0001), but
the processor should fail when it attempts to evaluate the "employee"
navigation, raising the error err:XPTY0020
Comment 2 Carmelo Montanez 2005-10-26 15:03:35 UTC
Agree:

Changed test to use position() with the context item undefined.
Please close bug if you agree with resolution.  New test looks like this:

(: Name: position-2 :)
(: Description: Evaluation of "fn"position", where the context node is not 
defined. :)

(: insert-start :)
declare variable $input-context1 external;
(: insert-end :)

position()

Thanks,
Carmelo
Comment 3 Martin Probst 2005-10-26 15:18:24 UTC
Yes, I do agree.