xml processing : too slow...
Shagshag13
shagshag13 at yahoo.fr
Thu Jul 25 09:24:01 EDT 2002
i think i still miss something as i get :
>>> line = 'this <tag1><tag2>is</tag2></tag1> an example of the kind of <tag3>line</tag3> that <tag3 attribute="this is a value">i
could have</tag3> and that i must check (could also contain 0-9, $ and punctuations)...'
>>> p.Parse(line, 1)
Traceback (most recent call last):
File "<pyshell#12>", line 1, in ?
p.Parse(line, 1)
ExpatError: junk after document element: line 1, column 0
>>> 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
this time line is really representative of the kind of suff i had (sentences with tag)
(i had written a wrapper to handle this with find('<'), find('>'), and i check well formedness by using a stack...)
but i would really understand why it doesn't work !
thanks,
s13.
More information about the Python-list
mailing list