W3C home > Mailing lists > Public > public-qt-comments@w3.org > August 2003

Re: namespace nodes in element content

From: Per Bothner <per@bothner.com>
Date: Tue, 26 Aug 2003 07:51:20 -0700
Message-ID: <3F4B73E8.10207@bothner.com>
To: "Kay, Michael" <Michael.Kay@softwareag.com>
Cc: public-qt-comments@w3.org

Kay, Michael wrote:

> XQuery does not provide the namespace axis, and does not provide any 
> other construct that allows you to get your hands on a namespace node. 
> Therefore, the sequence that provides the content for a new element can 
> never contain namespace nodes, except in the very limited and controlled 
> way allowed by computed namespace constructors.

That wasn't the issue I've asked about.  I was asking why not allow:

let $n := namespace metric {"http://example.org/metric-system"}
<altitude>{
   $ns,
   attribute {"metric:unit"} {"meter},
   10000
}</altitude>

However, I now see the following sentence which I overlooked before:

   The immediately enclosing expression of the computed namespace
   constructor must be a computed element constructor; otherwise a
   static error is raised.

I missed this, as I would have expected this constraint to be
expressed in the grammar.  That could express it clearer, and
also add the cnstraint that the namespace nodes must come first:

CompElemConstructor  	   ::=
      	(("element" QName "{") | ("element" "{" Expr "}" "{"))
         ((CompNSConstructor ("," CompNSConstructor)* | ExprSingle)
         (", " ExprSingle)*)? "}"
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/
Received on Tuesday, 26 August 2003 11:15:14 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:13 UTC