At 11.37 30/09/2004 -0400, Dan White wrote:
OK, in reading data from a socket, you either do a "read_n" with a big
enough buffer to hold any meggase you might get or you do repeated smaller
reads until you arrive at some agreed-upon separation of message traffic.

I am currently using a DOM input parser/validator with the first method
(big buffer), but it was pointed out to me that this could cause trouble
if the message size outgrows the buffer.

Contrarywise, SAX processes the stream flow and can handle any size
statement.

In Xerces both DOM and SAX parsers use the same XMLReader/XMLScanner objects; so, both of them should either work or not work in your environment. It's up to the InputSource you are using to properly merge the socket traffic. In my opinion, switching to SAX will not help you.


Alberto


My dilemma is that I have written a bunch of code that starts from a DOM
tree in memory.  If I switch the input/validation to SAX, my choices are
to either rewrite all the rest of the code to accomodate the SAX "process
it as you parse it" way of processing or create a DOM tree from the SAX
and the proceed as before.

I am looking for info to implement the second choice.

On Thu, 30 Sep 2004, Alberto Massari wrote:

> At 08.03 30/09/2004 -0400, Dan White wrote:
> >Bump.
> >
> >Anyone have a clue on this ?
>
> I don't have quite understood what is your problem: what is the connection
> between "pulling a complete XML statement off the data stream", "a DOM
> parser with a large input buffer" and "building a DOM out of a SAX parser"?
>
> Alberto
>
>
> >On Sep 26, 2004, at 1:09 AM, Dan White wrote:
> >
> >>Is there a reasonably simple way to build a DOM Tree with SAX events ?
> >>
> >>I am working on a client-server that communicates by XML over a
> >>socket.  Some of the other developers are having trouble pulling a
> >>complete XML statement off of the data stream.
> >>
> >>I implemented a DOM Parser with a very large input buffer and have had no
> >>problems (Yet)
> >>
> >>It was suggested that a SAX Parser would not have size limitations or the
> >>problem of finding the end of the statement, but I have already written a
> >>lot of code to process a DOM tree and would like to be able to create one
> >>from the SAX Parser.
> >>
> >>Thanks in advance.
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to