[XQuery] In-scope vs. statically known namespaces

Two questions regarding section 3.7.4 "In-scope Namespaces of a 
Constructed Element":

1. Since a namespace binding is always created for "xml" is "xml" 
always listed among the fn:in-scope-prefixes of any constructed 
element?
2. Is "xml" also always listed for the fn:in-scope-prefixes of 
non-constructed elements; for example those traveled to from fn:doc? If 
so, perhaps this section should be renamed or a new section added for 
the namespaces of elements retrieved from external sources. I don't see 
"xml" listed in the Data Model but it is inconsistent for it to exist 
for constructed elements but not pre-existing ones.

It's not clear why "xml" was singled out to always have a namespace 
binding, while the other pre-defined namespaces such as "local" and 
"xs" don't have one. It seems that either all or none (preferred) of 
the predefined namespaces should be bound. Along these lines, only the 
URI of "xml" can be retrieved via fn:namespace-uri-for-prefix, which is 
confusing.

As a "way past last call" request, I suggest:
fn:namespace-uri-for-prefix($prefix as xs:string) xs:anyURI, which 
would return the URI for a static prefix, and a new context function:
fn:static-prefixes(), which returns the prefixes of the statically 
known namespaces.

--Sarah

Received on Friday, 18 February 2005 18:27:23 UTC