A FIFO data structure( a queue in particular ) would be ok for what you need , on one end you could push data and on the other you can read line-by-line . I haven't tried the sax-based parser but the libraries/modules I've used in both Perl/C++ were building a tree structure in memory in which they fitted the XML , if this is what the sax-based parser does also it won't be of any use because by passing the XML in a stream you'll have a incomplete XML and thus it won't be a valid XML,but just part of a valid one(the original one you're sending through http).

To sum up , 2 threads/processes , one reading the XML from the stream , one processing the queue and filling up an entry structure, when you hit the end tag of your entry   < / name_of_tag > , put it in a DB and continue. You'll also need some form of IPC and you'll need the queue to be shared among the threads/processes.


In reply to Re: Processing XML stream via HTTP by spx2
in thread Processing XML stream via HTTP by thistle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.