RE: namespace node implementation

> I've been asked to provide a legal disclaimer before I "start posting 
> code and algorithm."
> 
> I have not looked at how other implementations handle 
> namespace nodes. 


There are sufficiently many open source XSLT processors that I think you can
be reasonably confident that any sensible ideas you come up with have
already been tried in one or more of them, and that they are therefore
covered by prior art.

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.

Michael Kay

Received on Wednesday, 22 October 2003 05:22:43 UTC