xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dane Foster" <dfos...@equitytg.com>
Subject Re: Question about document type nodes and JAXP
Date Tue, 17 Oct 2000 15:56:03 GMT
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

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).

----- Original Message -----
From: "Eric Hodges" <harmony2@swbell.net>
To: <general@xml.apache.org>
Sent: Monday, October 16, 2000 11:28 PM
Subject: Re: Question about document type nodes and JAXP

> ----- Original Message -----
> From: "Dane Foster" <dfoster@equitytg.com>
> To: <general@xml.apache.org>
> Sent: Monday, October 16, 2000 4:17 PM
> Subject: Re: Question about document type nodes and JAXP
> > I'm having trouble understanding why you would want to duplicate an XML
> > document in memory.  Please explain.
> We serialize XML documents between different processes over RMI.  We also
> save them in databases.  It isn't a simple duplication; the original
> document is on some other machine.  When the client receives a serialized
> XML document, it isn't in DOM format (because DOM classes aren't
> serializable).  So we have our own lightweight classes that can represent
> all the DOM nodes.  The client gets these nodes and asks them to put build
> DOM document.  Since Document Type is just another node, Document doesn't
> know anything about it when it is first created.
> I'll probably change our design so that DocumentType isn't a node at all,
> but an attribute of Document.  I guess I was misled by the fact that in
> DocumentType extends Node.
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org

View raw message