"Arnold, Curt" wrote:
> 
> Basically, that suggested to me that if you were able to hint that
> at a certain place in the document, a flyweight implementation of Node
> were used (child content was held as a single string, flyweight 
> implementations
> of Node, Attribute were mapped onto the string on use), you could
> have the best of both worlds, keep the XML representation and DOM access
> while avoiding the memory bloat of fully expanding the tree.

There are indeed ways to make the DOM lighter than it is today in
Xerces. But storing an element content as a string, for instance,
requires reparsing the string whenever you want to access it as nodes.
So, as usual, the gain is memory is achieved at the expense of
efficiency. In some context this may be better, in some others it won't.
There is no general answer to this problem. You need to have different
implementations in different contexts.
-- 
Arnaud  Le Hors - IBM Cupertino, XML Technology Group

Reply via email to