RE: computed namespace constructors

At 08:03 AM 11/25/2003, Kay, Michael wrote:

>Thanks for the comment. In fact this problem with computed namespace 
>constructors has already been noted by the working group. The WG 
>considered two alternatives, making the effect entirely static (an 
>equivalent to xmlns="x" for use with computed element constructors) and 
>making it totally dynamic. The current spec which has both static and 
>dynamic effects is unworkable. The decision was made to go for a purely 
>static approach - which means that both the prefix and the uri must be 
>known statically. It was decided not to offer any facility for dynamic 
>construction of namespace nodes (analagous to XSLT's <xsl:namespace> 
>instruction) in XQuery 1.0, on the grounds that it's not needed very 
>often. Unfortunately this decision was made too late for the November draft.

There's a second thing that is unclear, and which the Working Group is also 
aware of:

> >
> > The semantics of computed namespace constructors is unclear:
> >
> >    3.7.3.7 Computed Namespace Constructors
> >    A constructed namespace node ... binds a namespace prefix
> > represented
> >    as NCName in the syntax) to a URI and adds the namespace
> > prefix to the
> >    in-scope namespaces for its enclosing element.

Obviously, the above statement depends on a very different notion of what a 
namespace node is than the rest of the XQuery specification, in which a 
namespace node is found on every element for which a namespace is in scope.

 > > I suggest a separate concept of "active namespaces"
> > consisting of anmespaces declared in namespace attributes and
> > namespace constructors. This could be part of the dynamic
> > environment, but not the static environment.

Personally, I agree that this would be clearer. We inherited the namespace 
node model from XPath 1.0, and Working Groups tend to be conservative about 
changing such things, but there will probably be additional discussion on 
this topic.

Jonathan 

Received on Tuesday, 25 November 2003 11:39:03 UTC