Re: Question about Entity and EntityReferance again.

Ray Whitmer <ray@imall.com> writes:

> If iterators became available in the future that could keep track of
> traversal in and especially back out of shared entities (since they have
> no parent), it might be nice to allow a mode where shared entities (and
> perhaps default attributes as well) were not replicated in the hierarchy.

DOM level 2 should rely on iterators for traversal, and permit parent,
child, and sibling links to be null in certain cases. 

> > Any implementation is legal so long as it preserves the DOM interfaces.
> > The DOM API "presents the illusion" that all expanded entity references
> > have the subtree that would result from parsing the entity replacement text
> > as its children.

> I do not believe that nodes can be directly shared in this way, because
> getParentNode() on such nodes would not return the EntityReference.  I do
> a similar thing, but with proxy objects that hide the real shared objects
> behind the scenes.  I wish it were possible to do this without proxies at
> every shared node, but I don't see how.

You can have lazily-constructed proxy nodes, but I think that if you do a
complete traversal of the entity replacement text you will end up with a
complete copy of the original entity.  No good at all for streaming.

-- 
 Stephen R. Savitzky   Chief Software Scientist, Ricoh Silicon Valley, Inc., 
<steve@rsv.ricoh.com>                            California Research Center
 voice: 650.496.5710   fax: 650.854.8740    URL: http://rsv.ricoh.com/~steve/
  home: <steve@starport.com> URL: http://www.starport.com/people/steve/

Received on Monday, 24 August 1998 17:57:23 UTC