On Friday 30 April 2010 4:23:26 am Amila Suriarachchi wrote:
> 
> I think DOM Api can not support differed building. And that is why it has
> used a different API without implementing the DOM API.
> 
> For an example OMElement returns an iterator when getting children and xml
> parsing can be done when user calls getNext. But DOM elements returns a
> NodeList. When this node list returns whole set of children has to be read.
> 

The "normal" way to traverse a DOM doesn't use the NodeList thing.   The 
NodeList stuff isn't even threadsafe in Xerces.    NodeLists are also slower 
due to having to calc the number of children and such.

Normally, you call el.getFirstChild() and the child.getNextSibling() which 
could easily use deferred parsing.   If someone uses the NodeList things, then 
yes, you would need to pull everything in at once, but using normal 
traversals, you wouldn't.

-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog

Reply via email to