Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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.

    -nuffin
    zz zZ Z Z #!perl

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2019-07-22 20:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If you were the first to set foot on the Moon, what would be your epigram?






    Results (21 votes). Check out past polls.

    Notices?