[Bug 15689] New: [QT3] nscons-036

https://www.w3.org/Bugs/Public/show_bug.cgi?id=15689

           Summary: [QT3] nscons-036
           Product: XPath / XQuery / XSLT
           Version: Member-only Editors Drafts
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery 3 & XPath 3 Test Suite
        AssignedTo: benjie.nguyen@gmail.com
        ReportedBy: tim@cbcl.co.uk
         QAContact: public-qt-comments@w3.org


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.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 24 January 2012 11:28:46 UTC