W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2000

Re: DOM tree in memory

From: Terje Norderhaug <terje@in-progress.com>
Date: Thu, 28 Sep 2000 16:50:51 -0700
Message-Id: <b5f97f32030210041992@[]>
To: www-dom@w3.org
At 2:19 PM 9/28/00, Steve McIntosh wrote:
>Can anyone give me an idea of how much bigger, in percentage terms, a
>DOM-XML-tree tends to be compared with the flat XML file it comes from?
>My understanding is that the tree in memory can be significantly larger.
>But, how much larger?

This all depends on how each node is represented and how much markup vs
data the document contains. You will have to measure it in your specific
implementation to get a definite answer.

Memory usage doesn't even have to be larger for an in-memory representation
of a DOM file. You can build a DOM interface for a string that contains
just the characters of the XML file. You can even build a DOM interface
directly to the file using pointers into the file as nodes, resulting in
very low memory use (and a very slow DOM interface for more complex

Our Emilé XML editor [think Emacs with Mac ease of use and specialized for
XML editing] demonstrates that a DOM interface doesn't require an object
structure. Emilé has a DOM interface for its in-memory textual
representation of XML documents. That way, the editor doesn't have to
maintain a redundant DOM object structure for the same information
(although it also uses a DOM object structure depending on the situation).
It also allows DOM to be used locally in a document without requiring that
the document is well-formed at all times, which is a plus for text-based
XML editing.

-- Terje Norderhaug <terje@in-progress.com>

President & Chief Technologist
Media Design in*Progress
San Diego, California

Software for Mac Web Professionals at <http://www.in-progress.com>.
Take advantage of XML with Emile, the first XML editor for Mac.
Received on Thursday, 28 September 2000 19:42:49 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:07 UTC