Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Incremental parsing of multiple XML streams?

by paulbort (Hermit)
on Jan 07, 2005 at 22:05 UTC ( #420406=note: print w/replies, xml ) Need Help??

in reply to Incremental parsing of multiple XML streams?

One of the major selling points of XML is that it is well structured: an XML parser can determine if the data is well-formed.

It sounds like the right way to go would be to use a buffer that captures the XML as it comes in, then when it gets the closing tag that matches the first opening tag, cut the buffer off and send it to be parsed.

Perhaps the reason you're having a hard time is because you're fighting all of the things that have been done to make XML in Perl easy and reliable.

Spring: Forces, Coiled Again!
  • Comment on Re: Incremental parsing of multiple XML streams?

Replies are listed 'Best First'.
Re^2: Incremental parsing of multiple XML streams?
by nothingmuch (Priest) on Jan 08, 2005 at 14:13 UTC
    If that's the case, I can just wait for </xml>, and then parse that string up.

    But I need a SAX like interface, generating events for data, as it enters. I'm not concerned about the XML's tree at the end, because I need it's data parsed (as far as possible), as it arrives. The opening of an element concerns me before it's end is even on the data stream, let alone actually parsed.

    zz zZ Z Z #!perl

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://420406]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2020-08-07 20:27 GMT
Find Nodes?
    Voting Booth?
    Which rocket would you take to Mars?

    Results (48 votes). Check out past polls.