Re: namespace node implementation

[despite that this is not strictly xquery, i'll leave the thread where 
it is ...]

On Wednesday, Oct 22, 2003, at 11:22 Europe/Berlin, Kay, Michael wrote:

> ...
> Saxon's approach is essentially to store non-redundant namespace 
> declarations (and undeclarations) with the element nodes, and to 
> compute the set of namespace nodes when required by walking up the 
> ancestors. You can regard the set of namespace [un]declarations as 
> being a delta on the set of namespace nodes. I see no particular 
> reason to change that approach for 2.0, except that I'm slightly 
> concerned that the new rules for element construction (in both XQuery 
> 1.0 and XSLT 2.0) will lead to result trees that contain large numbers 
> of namespace undeclarations, in which case it might become more 
> efficient to store something that's rather closer to the actual data 
> model.
> I haven't yet implemented the new construction rules: when you add an 
> element to a new parent in Saxon today, it will inherit the namespaces 
> of its new parent, which is incorrect according to the spec.

have you tried an implementation based on a model which interns names? 
last time we corresponded about this - months-and-months ago, my 
conjecture was that, were one to do so, none of the requirements which 
concerned namespace node management would affect the implementation. 
one was skeptical. in the interim, if for no other reason that to 
satisfy my curiosity, i implemented an xslt compiler which targets the 
model and operators illustrated earlier in this thread. it confirmed my 
conjecture, at least to the extent that the only places where namespace 
bindings figure in the processing are
1. the operator which the standard defines to construct names from a 
prefix and a local part. whereby the prefix argument could well be 
supplanted with a namespace name argument, and
2. for prefix rebinding when serializing.

that is, if the parser - or at the latest the compiler, interns names 
the standard semantics can be achieved by a much simpler processor 
which observes prefix-namespace bindings on serialization only.

[... because, in the end, the same applies to xquery as to xslt.]


Received on Wednesday, 22 October 2003 08:59:02 UTC