You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Christopher Giblin <CG...@zurich.ibm.com> on 2002/03/08 16:26:28 UTC

Is the Xerces Document implementation java-serializable?

Hi
If I have an instantiated DOM, can I Java-serialize it (ie, not XML
serialization) without restriction?
At first glance, it looks like Xerces 2.0 DOM is serializable - is
intended to be so through and through? Or is it "java-serialize at your own
risk"?
Sorry if I missed this in the documentation - I need to be sure...
Thanks,
chris



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Is the Xerces Document implementation java-serializable?

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
You *can* Java-serialize the DOM representation, but it's generally a 
bad idea. Java serialization handles this type of tree structure poorly, 
and for most documents you'll end up taking much longer to 
Java-serialize/unserialize than it would take to 
text-serialize/unserialize. The Java-serialized form is also much larger 
than the text-serialized form. You can see some actual figures for this 
in my IBM developerWorks article at: 
http://www-106.ibm.com/developerworks/xml/library/x-injava/index.html#13

I've been horrible about posting updated results to my web site at 
http://www.sosnoski.com, but will try to get them out over the weekend. 
One interesting thing I've noticed with both Xerces 1 and 2 is that the 
default mode of using deferred node expansion appears to have a 
substantial per-document memory overhead. This far outweighs any savings 
from the compressed node handling for small documents. Anybody have any 
clues why that might be the case?

  - Dennis

Christopher Giblin wrote:

>Hi
>If I have an instantiated DOM, can I Java-serialize it (ie, not XML
>serialization) without restriction?
>At first glance, it looks like Xerces 2.0 DOM is serializable - is
>intended to be so through and through? Or is it "java-serialize at your own
>risk"?
>Sorry if I missed this in the documentation - I need to be sure...
>Thanks,
>chris
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org