[Bug 12554] New: [F+O 3.0] Clarify terminology for default namespace

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

           Summary: [F+O 3.0] Clarify terminology for default namespace
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.0
        AssignedTo: mike@saxonica.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


This arises from XQuery test suite bug #11590.

In fn:namespace-uri-for-prefix() there are two problems:

(a) The term "default (unnamed) namespace" is nonsense: every namespace has a
namespace name. What is intended is "default namespace".

(b) The sentence "Otherwise, it returns the empty sequence." is preceded by two
conditionals, and it's not clear which one the "otherwise" relates to. I
believe the first is intended.

I propose to recast the rules as follows:

Rules

If $prefix is the empty sequence, the function behaves as if $prefix were the
zero-length string.

If $element has an in-scope namespace whose namespace prefix is equal to
$prefix, it returns the namespace URI of that namespace.

Otherwise, it returns the empty sequence.

Prefixes are equal only if their Unicode codepoints match exactly.

Note

If $prefix is the zero-length string or the empty sequence, then:

* if there is a default namespace, the namespace URI of the default namespace
is returned

* if there is no default namespace (that is, if there is no declaration of the
form xmlns="uri", or if there is a declaration of the form xmlns=""), the
function returns the empty sequence.

The rules for fn:in-scope-prefixes() are also open to misreading. It states
"For the default namespace, which has no prefix, it returns the zero-length
string." This could be read as meaning that the result sequence always includes
the zero-length string. In fact it includes the zero-length string only if the
in-scope namespaces contains a binding for the zero-length string (that is, a
default namespace), which will be true only if there is a namespace declaration
of the form xmlns="non-empty-URI" in force. I propose fixing this editorially.

-- 
Configure bugmail: http://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 Monday, 25 April 2011 21:36:33 UTC