Andy,
I need to transmit an XML string from data that I have put into the DOM.
Are you saying that Xerces is not a good choice to implement this and
should I be doing this by hand then?
I'm trying to do this in as close to real time as possible, so I do need good performance.
Thanks for the socket info, kinda what I expected, I'll look into what Xerces2 does...
Thanks,
-Pete
| Andy Clark <[EMAIL PROTECTED]>
10/22/2001 10:05 PM
|
To: [EMAIL PROTECTED] cc: Subject: Re: Xerces serialization memory usage (and related stuff) |
[EMAIL PROTECTED] wrote:
> I build up the representation of the output document in DOM and use
> the XMLSerializer (DOMSerializer) to give me a string representation.
Serializing to a String is not a good idea because it will
constantly have to re-allocate blocks of memory to fit the
characters. Of course, it all depends on what you end up
doing with that String -- perhaps this is your only option.
> Unfortunately, it doesn't seem that InputSource is socket
> 'friendly'. It seems to hang waiting for input to complete.
There are two problems: 1) XML documents only end when the
stream is closed because there is nothing in an XML document
that denotes the end; 2) Xerces 1.x will only start parsing
once it has filled its internal buffer (or if the stream
closes) -- Xerces2 does not have this problem.
You have to find a "clever" way to solve the first problem.
You may find the socket.io.WrappedOutput/InputStream classes
useful. They are part of the Xerces2 samples but can be used
generically. Check the JavaDoc of these classes for details.
--
Andy Clark * IBM, TRL - Japan * [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
