That's not at all how the deferred DOM implementation works. No part of 
the document is skipped. Deferred DOM defers creation of nodes [1], only 
building them as the tree is traversed. The scanner which sits at the 
front of the pipeline parses the document and if the document isn't 
well-formed it'll report that.

[1] http://xml.apache.org/xerces2-j/features.html#dom.defer-node-expansion

Elliotte Harold <[EMAIL PROTECTED]> wrote on 12/19/2004 05:58:56 AM:

> Curtiss Howard wrote:
> 
> 
> > For a small file, SAX only had a 20% performance advantage over DOM. 
> > I'd expected much more.  Surprisingly enough, as I increased the size
> > of the file being parsed, the performance advantage _narrowed_, not
> > widened, as I'd expected.  Obviously the parse is going to be somewhat
> > slow due to schema validation, but I'm confused as to why SAX is
> > performing so poorly compared to DOM.  Can anyone shed some light on
> > this?
> 
> Is it possible you're using the deferred DOM implementation? If so, 
> Xerces DOM parser is not actually parsing part of the file until you 
> actually walk the tree. That would explain why it seems to speed up with 

> larger documents: more to skip. Personally I think this behavior is 
> nonconformant to the XML and DOM specifications--it fails to detect 
> well-formedness errors as early as required--but others disagree with 
me.
> 
> -- 
> Elliotte Rusty Harold  [EMAIL PROTECTED]
> XML in a Nutshell 3rd Edition Just Published!
> http://www.cafeconleche.org/books/xian3/
> http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to