I am working on a xmpp chat application for windows phone 7.
It receives xmpp packets through the stream. Now I need to parse the xml content which comes through sockets.
For windows phone 7 we do not have SAX like parser which sits on the stream and provides us with packets.
We do not have network stream, TCP client available in windows phone 7.
\because the content comes through the stream in packets I need a stream in which I could write data on the fly.
We have a xmlreader but does not work if I use memory stream .
Do we have a SAX like parser Which could read the xml content from the socket and parse the xml content?
Please help me on how to parse the xml content coming from sockets.
XmlReadershould work absolutely fine on aMemoryStream– but remember that when you’ve written to the stream you need to “rewind” it before you start reading from it:Note that you don’t need to use
XmlReaderexplicitly – callingXDocument.Load(Stream)works fine.