On Thu, 2004-08-19 at 08:00, Bob Jamison wrote:
I am almost done with a "default" DOM implementation, now I need to start on the repr-oriented implementation.
One thing to be aware of is that DOM does namespaces a little differently than we do -- it expects a ( qname, namespace_uri ) tuple to be stored for each element/attribute name.
This actually has no relationship to the xmlns declarations currently in effect -- so you can glom arbitrary prefix/namespace combinations into the tree, and if you serialize it later it's up to the serialization implementation to work out a sane set of prefixes to use.
By contrast, the model we use in SPRepr currently is to store only qnames, and force a global prefix<->namespace mapping onto everything -- effectively we store expanded names, using prefixes as a shorthand.
I plan to keep this system in AST (with a few refinements so there aren't any nasty ambiguous cases), so be aware that to make DOM behave as expected you will need to store a "DOM prefix" somewhere for every element/attribute name, which would be the prefix that was set via the DOM API. The namespace URI and local name, however, can be derived from the Repr/AST "expanded" name.
-mental