[Bug 4763] 1.0.3dev: K2-InScopePrefixesFunc-12

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4763

           Summary: 1.0.3dev: K2-InScopePrefixesFunc-12
           Product: XML Query Test Suite
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XML Query Test Suite
        AssignedTo: andrew.eisenberg@us.ibm.com
        ReportedBy: tim@cbcl.co.uk
         QAContact: public-qt-comments@w3.org


The expected result for:

        count(in-scope-prefixes(exactly-one($i/*[namespace-uri() eq ""]))),

in this query is 2.  I believe the answer should be one (corresponding to the
predefined xml namespace).  As I understand it

element {QName("", "a")} {}

will create an element whose local name is "a" and with an empty namespace,
effectively:

<a xmlns="" />

Since xmlns="" removes a namespace binding, this only leaves the prefix "xml"
in scope, therefore the count is one.  Or am I mistaken?

(:*******************************************************:)
(: Test: K2-InScopePrefixesFunc-12                       :)
(: Written by: Frans Englich                             :)
(: Date: 2007-06-14T10:15:27+01:00                       :)
(: Purpose: Check the in-scope namespaces of different elements, constructed
wit
h computed constructors. :)
(:*******************************************************:)
declare default element namespace "http://www.example.com/";
let $i := element e
{
    element {QName("", "a")}                                {},
    element {QName("http://www.example.com/", "b")}         {},
    element {QName("http://www.example.com/Second", "c")}   {}
}
return (count(in-scope-prefixes($i)),
        count(in-scope-prefixes(exactly-one($i/*[namespace-uri() eq ""]))),
        count(in-scope-prefixes(exactly-one($i/b))),
        count(in-scope-prefixes(exactly-one($i/*[namespace-uri() eq
"http://www.
example.com/Second"]))),
        $i)

Received on Tuesday, 26 June 2007 13:12:46 UTC