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

belated namespace declaration attributes

From: Per Bothner <per@bothner.com>
Date: Wed, 26 Nov 2003 20:13:04 -0800
Message-ID: <3FC579D0.50608@bothner.com>
To: public-qt-comments@w3.org

Consider the following query:

declare namespace n = "N";
declare namespace m = "M";
declare variable $n:x {"nx"};
declare variable $m:x {"mx"};
declare variable $e {<e n:a="{$n:x}" xmlns:n="M"/>};
declare variable $f {<f a="{$e/@a}" xmlns="M"/>};
<result>
e: {$e}
f: {$f}
</result>

The output I expect is:

<result>
e: <e xmlns:n="M" n:a="mx"/>
f: <f xmlns="M" a="mx"/>
</result>

Saxon 7.8 emits:

<result>
e: <e xmlns:n="M" n:a="nx"/>
f: <f xmlns="M" a=""/>
</result>

Kawa doesn't handle namespace declaration attributes,
but it's next on my list of projects to tackle.

This is tricky to implement (and for humans to read),
because the namespace declaration attribute follows
an enclosed expression that makes use of it.  This
means that namespace resolution cannot be done during
the first parsing pass.

XQuery could avoid this complexity, by requiring that
namespace declaration attributes come before regular
attributes - or at least before any enclosed expressions.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/
Received on Wednesday, 26 November 2003 23:13:00 UTC

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