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 15689 - [QT3TS] nscons-036
Summary: [QT3TS] nscons-036
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3 & XPath 3 Test Suite (show other bugs)
Version: Member-only Editors Drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Matthias Brantner
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-24 11:28 UTC by Tim Mills
Modified: 2012-06-06 09:01 UTC (History)
3 users (show)

See Also:


Attachments

Description Tim Mills 2012-01-24 11:28:41 UTC
My results do not agree with the expected results of this test.

modl:nested is a function defined in a module with no copy-namespaces declaration.  Therefore it operates with the default of "inherit, preserve".

declare function mod1:nested() as element() {
  element outer { 
    namespace out { "http://out.zorba-xquery.com/" },
    element inner {
      namespace in { "http://in.zorba-xquery.com/" }
    } 
  }
};

Starting from the outside in, 

    element inner {
      namespace in { "http://in.zorba-xquery.com/" }
    } 

creates an element "inner" with namespace nodes for "xml" and "in".

This element is then copied during the creation of element outer with copy-namespaces mode "inherit, preserve".  The copy of inner has three namespaces nodes: "xml", "in" (preserved) and "out" (inherited from outer).

Thus I believe a call to modl:nested() will return

<outer xmlns:out="http://out.zorba-xquery.com/">
  <inner xmlns:in="http://in.zorba-xquery.com/"/>
</outer>

in which outer has namespace nodes for "out" and "xml", and inner has namespaces nodes for "in", "out" (which it inherits at the from outer at the point it is copied) and "xml".

In the main module, the test has:

import module namespace mod1="http://www.w3.org/TestModules/cnc-module";
declare copy-namespaces preserve, no-inherit;
let $nested := mod1:nested(),
    $elem := element e { namespace new { "http://new.zorba-xquery.com/" }, $nested }
return
    $elem/outer/inner

When copied in element e, outer will not inherit "new" (by virtue of the specified copy-namespaces mode), but outer's namespace nodes "out" and "xml" will be preserved, as will inner's namespace nodes "in", "out" and "xml".

Therefore the expected result should be 

<inner xmlns:in="http://in.zorba-xquery.com/" 
       xmlns:out="http://out.zorba-xquery.com/"/>

and not

<inner xmlns:in="http://in.zorba-xquery.com/"/>

as given.
Comment 1 O'Neil Delpratt 2012-05-18 15:16:55 UTC
Test assigned to Matthias to review
Comment 2 Matthias Brantner 2012-06-04 21:08:46 UTC
The expected result was fixed as described by Tim (see rev. 1.7 of prod/CompNamespaceConstructor.xml)
Comment 3 Tim Mills 2012-06-06 09:01:48 UTC
Confirmed fixed.  Thanks.