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 2430 - Error code for position-2 is incorrect
Summary: Error code for position-2 is incorrect
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 Windows XP
: P2 normal
Target Milestone: ---
Assignee: Carmelo Montanez
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-02 14:51 UTC by Michael Kay
Modified: 2006-06-22 12:56 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2005-11-02 14:51:30 UTC
Error code for position-2 is incorrect, and the test doesn't do what it was
designed to do. The test is 

employee[position() = 1]

which fails because the axis step for child::employee is evaluated without a
context node. It doesn't get as far as evaluating position(), and if it did, the
context position would be well-defined as it's in  a predicate.

A better test would be say

position() + 1

on its own or as the body of a function.
Comment 1 Carmelo Montanez 2005-11-04 19:59:00 UTC
Mike:

Are you sure you are looking at the correct test?. Position-2 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()"

The catalog makes reference to "works-mod", which is misleading (and I will 
remove), however that should not be a problem for the test.
Comment 2 Michael Kay 2005-11-04 23:49:43 UTC
Strange. Yes, I've checked, and I think I'm looking at the right test. In both
0.7.0 and 0.8.0 the test position-2 reads

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

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

employee[position() = 1]
Comment 3 Carmelo Montanez 2005-11-07 14:51:39 UTC
Mike:

I think I gotten to the bottom of the problem.  I wrote the test and loaded in 
my local cvs repository, but failed to check the test in.  It should be 
there now.

Thanks,
Carmelo