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 5825 - id-typeswitch-expr-02
Summary: id-typeswitch-expr-02
Status: RESOLVED FIXED
Alias: None
Product: XQuery Update Facility Test Suite
Classification: Unclassified
Component: XQuery Update Facility Test Suite (show other bugs)
Version: unspecified
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-02 12:27 UTC by Tom Brosens
Modified: 2008-11-06 17:26 UTC (History)
2 users (show)

See Also:


Attachments

Description Tom Brosens 2008-07-02 12:27:51 UTC
Test
----
Test group: TypeswitchExpression
Test query: id-typeswitch-expr-02
Verification query: id-typeswitch-expr-02-test
 
Problem
-------
The test inserts a node using 'insert into' without defining a position explicitely. Therefor the position of the inserted node amongst the existing nodes is implementation-dependent. Because of this there are a number of different but correct results possible for this test. 
 
For instance the following result of the verification query is correct:
 
<employee name="Jane Doe 1" gender="female">
   <empnum>E1</empnum>
   <pnum>P1</pnum>
   <hours>40</hours>
  <hours>20</hours></employee>
 
but it does give a difference (using XMLFragment via XMLDiff) with the expected result:
 
<employee name="Jane Doe 1" gender="female">
   <empnum>E1</empnum>
   <pnum>P1</pnum>
   <hours>40</hours><hours>20</hours>
  </employee>
 
The difference report from XMLDiff is:
 
[not identical] Expected sequence of child nodes '6' but was '7' - comparing <hours...> at /root[1]/employee[1]/hours[2] to <hours...> at /root[1]/employee[1]/hours[2]
 
[different] Expected text value '
  ' but was '
   ' - comparing <employee ...>
  </employee> at /root[1]/employee[1]/text()[4] to <employee ...>
   </employee> at /root[1]/employee[1]/text()[1]
 

Resolution
----------
The resolution could be to define all possible results, but maybe it's better to make the verification query more specific and thus more implementation independent. It could be changed to: 
 
(: Name: id-typeswitch-expr-02-test :)
(: Description: Query to verify id-typeswitch-expr-02 :)
 
(: insert-start :)
declare variable $input-context external;
(: insert-end :)
 
$input-context/works[1]/employee[1]/hours
 
Remark
-----------
The same issue exists for id-typeswitch-expr-03
Comment 1 Andrew Eisenberg 2008-11-06 17:26:40 UTC
I've fixed these test cases in the way that you've suggested.

Please close this bug report if you are satisfied with this response.