xml parsing with sax

Harald Kirsch kirschh at lionbioscience.com
Fri Apr 27 13:07:19 EDT 2001


"Steve  Holden" <sholden at holdenweb.com> writes:

> "Harald Kirsch" <kirschh at lionbioscience.com> wrote in message
> news:yv28zkm63gi.fsf at lionsp093.lion-ag.de...
> >
> > I have more (or less) XML data, however it is missing a root element
> > or, put another way, it is like a sequence of individual XML documents
> > similar to
> >
> >   <bla>...</bla>
> >   <bla>...</bla>
> >   <bla>...</bla>
> >   <bla>...</bla>
> >
> > Trying to parse this with python's inbuilt sax results in an error
> > message about 'junk after document element', i.e. after the first
> > </bla>. In a way this is correct because a surrounding root element is
> > missing. However, is there a way to instruct sax to keep going. Or is
> > it possible to push a pseudo root element in front of a stream parsed
> > with
> >
> >   xml.sax.parse(sys.stdin, ...)
> >
> Unless your XML is huge (always a possiblity...) you could use something
> like:

It *is* huuuugge. Well, and in particular it is generated in a pipe
and I want to see some output as soon as possible and not after
several megabytes are digested.

  Harald Kirsch

-- 
----------------+------------------------------------------------------
Harald Kirsch   | kirschh at lionbioscience.com | "How old is the epsilon?"
LION bioscience | +49 6221 4038 172          |        -- Paul Erdös
       *** Please do not send me copies of your posts. ***



More information about the Python-list mailing list