in reply to How to parse XML coming from a socket?

Have you looked at XML::Stream?

Also, XML::Parser actually can parse a stream of XML documents, separated by a delimiter. See the StreamDelimiter option.

  • Comment on Re: How to parse XML coming from a socket?

Replies are listed 'Best First'.
Re: Re: How to parse XML coming from a socket?
by vadim_t (Acolyte) on Oct 04, 2003 at 17:06 UTC

    Thanks, XML::Stream seems to be pretty much what I need. It looks like the timeout in Process can be exactly what I need to get it done.

    It also seems that I could use the StreamDelimiter thing, although then it looks like I'd have to pick some string that wouldn't appear in normal output.

      and take a look at Net::Jabber this time because it uses XML::Stream for it's reading/writing sockets. (and not because you are reinventing it =P)

      from what i gleaned from your other posts i think you do need to wrap your messages in a top-level node like:

      <data> <stuff>whatever goes here</stuff> <to>server</to> <from>client</from> </data>

      if you want to make things easier.

      and you should check out the Jabber specs just because there's a lot of thought out XML in the specs (and the experimental specs) for things like queries/messages/presence and just about anything else you could think of to pass through an XML message router.