Stanimir Stamenkov <stanio@xxxxxxxxxxxxx> wrote on 06/16/2006 04:28:44 PM:
> /Michael Glavassevich/:
> > Djakisback <djakone@xxxxxxxxxxx> wrote on 06/16/2006 04:18:37 AM:
> >
> >> I'd like to know if someone knows a way to reduce DOM trees size ?
(in
> >> modifying properties or something else)
> >
> > If you absolutely don't need a namespace-aware DOM (no schema
validation,
> > XSLT, XInclude, etc...) you can reduce memory usage by turning
namespace
> > processing off.
>
> Using the "ignoringElementContentWhitespace" [1] feature could also
> help a lot. Note, currently it works only using DTD [2] (not XML
> Schema, for example). I've noticed it works with Xerces even in
> non-validating mode - just DTD should be supplied which could be
> conveniently done through the EntityResolver2.getExternalSubset()
> interface for documents not having a DOCTYPE declaration.
Or you could use the DOM Level 3 LSParser [1] and filter out content
(including whitespace) you're not interested in with an LSParserFilter
[2].
[1]
http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSParser
[2]
http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html#LS-LSParserFilter
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@xxxxxxxxxx
E-mail: mrglavas@xxxxxxxxxx
|