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 3960 - fn-in-scope-prefixes-3
Summary: fn-in-scope-prefixes-3
Status: CLOSED INVALID
Alias: None
Product: XML Query Test Suite
Classification: Unclassified
Component: XML Query Test Suite (show other bugs)
Version: 1.0.1
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-08 16:59 UTC by Tim Mills
Modified: 2006-11-09 10:24 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2006-11-08 16:59:35 UTC
If I understand this correctly,

fn:in-scope-prefixes(<anElement>some content</anElement>)

should return a sequence of two prefixes, namely the "" (empty xs:string) and "xml" (xs:NCName).

From:

http://www.w3.org/TR/xslt-xquery-serialization/#serdm

following the serialization rule:

"For each subsequence of adjacent strings in S2, copy a single string to the new sequence equal to the values of the strings in the subsequence concatenated in order, each separated by a single space. Copy all other items to the new sequence. The new sequence is S3."

Shouldn't the expected answer here be " xml" or "xml ", and not "xml" as specified?
Comment 1 Michael Kay 2006-11-08 21:54:23 UTC
>If I understand this correctly,
>fn:in-scope-prefixes(<anElement>some content</anElement>)
>should return a sequence of two prefixes

No, it should only return one. The prefix "" is not bound to any namespace, so there is no namespace node/binding for it. This would be true even if the element were written <anElement xmlns="">some content</anElement>: this undeclares a namespace (deletes a namespace binding), it does not create a new binding.

Michael Kay 
Comment 2 Tim Mills 2006-11-09 07:42:37 UTC
Thanks - I understand now.  

I was under the impression that the empty namespace was bound here to the default element namespace.  Following the rule in XQuery 3.7.4 (In-scope Namespaces of a Constructed Element):

"For each namespace used in the name of the constructed element or in the names of its attributes, a namespace binding must exist."

Here I'd thought that <anElement> has the local name "anElement", prefix "" and the default element namespace.  Of course, in this example the default namespace is "no namespace".
Comment 3 Michael Kay 2006-11-09 10:07:58 UTC
For some reason that I've never understood, but that has caused untold confusion ever since, the authors of the Namespaces Rec went out of their way to insist that what we sometimes call the "null namespace" and what you call the "empty namespace" or "no namespace" is not in fact a namespace. So when you read a phrase like "for each namespace..." it doesn't include the null|empty|no|absent namespace, because that isn't a namespace. 

No prefix is ever bound to this non-namespace; no namespace binding or namespace node ever references it. Declarations like xmlns="" and in XML 1.1, xmlns:p="" terminate a binding, they do not create a new one.
Comment 4 Tim Mills 2006-11-09 10:24:39 UTC
Thanks for the clarification.

BTW, my use of "no namespace" was in taken from XQuery C.1 Static Context Components.