[libxml++] Parsing streams of XML



Hi,

I've no previous experience with parsing XML, but I'm trying to write
a library for interpreting Jabber XML streams (for a Gnome 2 Jabber
client).

Can I do that with libxml++? The problem is that my data comes in
unpredictable chunks from a network socket - I get a signal from
libgtcpsocket whenever it happens. I've thought about using the
SaxParser, but I can't feed it small chunks, can I? Suggestions?


Also, the SaxParser seems to be a little bit inconvenient. The XML
comes in chunks:

  <stream:stream to='host' xmlns='jabber:client'
                   xmlns:stream='http://etherx.jabber.org/streams'>

  ... new chunk arrives

    <message from='node host' to='receiving-ID'> 
      <body>Watson come here, I need you!</body> 
    </message>

  ... new chunk arrives

    <message from='node host' to='receiving-ID'> 
      <body>Watson come here, I need you!</body> 
    </message> 

  ... new chunk arrives

    <presence to='node host' from='blabla somewhere'>
      <status>Online</status>
    </presence>

  ...

  </stream:stream> 

So each of these <message> and <presence> elements are small documents
in themselves. If I could get a DOM-representation of each of them, it
would somewhat easier I think. Any hints?

-- 
Ole Laursen
http://www.cs.auc.dk/~olau/




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