The Peace Process: DOM and namespaces...

Chris Lovett clovett at microsoft.com
Fri Feb 12 20:31:32 GMT 1999


An interesting thread.  First, the DOM committee is addressing this issue
this week.  IMHO the degree in which XML namespaces succeed will determine
the breadth and depth of the success of XML in general, and not just XSL -
so I eagerly await what the DOM committee comes up with.

We have a namespace implementation in our DOM which we are shipping in IE5,
and I think IBM and Sun also have a solution.  I didn't fully understand all
the arguments presented here - but our experience is that although
namespaces are not trivial to implement in an efficient manner, it is
doable.

In the IE5 DOM implementation we expose namespaces via new properties on the
node, "namespaceURI", "basename" and "prefix" and we added a new createNode
method to DOMDocument that allows you to specify a namespaceURI for that
node.  Processing namespaces during document load was not too hard to
implement.  The most difficult thing was cut & paste and making sure the
saved document had all the right xmlns attributes.  We can probably improve
our implementation by minimizing the number of xmlns attributes we generate.

I did some experiments with hamlet.xml:
1) no namespaces 
2) put default namespace on the root PLAY tag 
3) put a prefix "p:" on all tags 
4) added a nested prefix "q:" on all the tags in ACT 1. 
5) gave all 5 acts a different prefix.

When looking at megabytes/second during load there was about a 1% delta
between 1 and 2 and a 7% delta between 1 and 3, but 3,4 and 5 were pretty
much indistinguishable.  So unless you have hundreds or thousands of
different namespaces in one document (which I don't anticipate to be the
norm), the performance is not too bad.


- Chris.

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list