xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Hodges <harmo...@swbell.net>
Subject Re: Question about document type nodes and JAXP
Date Tue, 17 Oct 2000 17:12:46 GMT

----- Original Message -----
From: "Dane Foster" <dfoster@equitytg.com>
To: <general@xml.apache.org>
Sent: Tuesday, October 17, 2000 10:56 AM
Subject: Re: Question about document type nodes and JAXP


> It seems to me as if you are creating more work for yourself.  If you have
> an XML Document as a DOM tree in memory why would you create lightweight
> classes to represent the DOM nodes?  Here is what I think might work
better
> for you:
>
> Use Xerces' XML serializer to write out your DOM object as a XML String.
> Save the String to your database or ship it over RMI wherever it needs to
> go.  The consumers of your document (the clients as you call it) will
simple
> need to use SAX to read the document back.  If you need the document as a
> DOM tree on the consumer's end you can use the DOM parser to reconstruct
it
> from the serialized XML stream (the String).  The Document type
information
> should remain intact because you simple wrote out the XML document as a
> String.
>
> Please keep in mind that I might have misunderstood what you are trying to
> do.  I'm not trying to over simplify what you are doing but it appears
> pretty straight forward from your description.  I hope I have been of help
> and if I'm still missing the point you can send some code that I will look
> at (preferably in Java).

We considered this early on, but the serialize and parse time was too
costly.  And we store the documents in the database as a set of Nodes, not
one big string.  Keeping a lightweight, serializable version of the document
around is very efficient.  We can convert it to DOM when we need XSLT or
other DOM services, but most of our operations can use the thin version.

We don't use SAX for anything.  Keeping track of context in the SAX parser
requires tons of ugly, hard to manage code.



Mime
View raw message