Re: [xml] xmlParseChunk...



sorry for my delayed response... I am only acoder for hobby.
i don't understand how jabber can be parsed if the sax parser starts 
parsing only if there are already 80 bytes in buffer in waiting.

to create stream i send "<stream:stream ...>" to server!
The server responds with "<stream:stream ...>" whatever the "..." and 

rest are not 80 bytes at all... thus the parser will not start if i 
understand you right. I can not send info to the server until my 
application recognizes the stream and this can only happen if the 
parser starts parsing.

how to circumvent this?

best regards
E.

On 3 Nov 2003 at 17:56, Daniel Veillard wrote:

On Mon, Nov 03, 2003 at 11:54:02PM +0100, aliban gmx net wrote:
On 3 Nov 2003 at 17:28, Daniel Veillard wrote:

  yes I know, I did a small Jabber implementation on top of SAX
using libxml2 2 years ago, so it's defintely doable.
  Still if the client send <foo>bar</foo> at the TCP/IP
socket interface, you have no garantee to receive the chunk in 
one block
the only thing saving it is taht usually the XML is "formatted"
and the linefeed will force a flush on the TCP/IP stream.

  Worked for me at the time.


if "<stream:stream ....>"
is received i send it to my reader and the reader will 
xmlCreatePushParserCtxt() to create the parser buffer. whatever 
this 
does not call any sax handler (at least it should call 
documentStart() +  elementStart already)

any further socket data is pushed to the reader and the reader 
does 
xmlParseChunk(). whatever this still does not result in callbacks 

like elementStart() ... how to do this!? i don't understand...

can you show me sample code?

  testSAX.c in the distribution.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine 
http://rpmfind.net/







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]