xml processing : too slow...

Shagshag13 shagshag13 at yahoo.fr
Thu Jul 25 14:22:48 EDT 2002


"Alex Martelli" <aleax at aleax.it> a écrit dans le message de news: CPV%8.118293$Jj7.2763401 at news1.tin.it...
> Shagshag13 wrote:
>
> >> p.parse('<fict>%s</fict>' % line, 1)
> >>
> >> should be satisfactory for checking this kind of "sort of
> >> well-formedness", unless there are yet more specs as yet
> >> unexpressed.
> >
> > that's why i had done :
> >>>> anotherline = '<root>' + line + '</root>'
> >>>> p.Parse(anotherline, 1)
> > Traceback (most recent call last):
> >   File "<pyshell#14>", line 1, in ?
> >     p.Parse(anotherline, 1)
> > ExpatError: junk after document element: line 1, column 0
> >
> > but it still don't work, as much has:
>
> But ARE you making a new parser object p for each line you
> have to parse?  I don't see the expat.ParserCreate call here.
> I've already indicated a few posts ago that you need that.

GREAT THANKS !!!

>>> p = expat.ParserCreate(); p.Parse('<fict>%s</fict>' % line, 1)
1

s13.





More information about the Python-list mailing list