[XML-SIG] xml.sax._exceptions.SAXParseException

FURLONG -, LAURA INES lfurlong at imim.es
Fri Nov 11 11:15:26 CET 2005


Thank you very much for your quick response. So quick that I have just realized that the problem is not in the parser but in the file! I download it from the NCBI web site, and it seems to be (sometimes) a problem during the download process resulting in a file that is not complete and therefore not well-formed. I have solved the problem checking first that the file downloaded is ok and then proceeded with the xml parsing.



-----Original Message-----
From: Mike Brown [mailto:mike at skew.org]
Sent: Thu 11/10/2005 8:38 PM
Cc: xml-sig at python.org
Subject: Re: [XML-SIG] xml.sax._exceptions.SAXParseException
> When I try to parse an xml file I get the following error:
>  File "<stdin>", line 1, in ?
>   File "/usr/lib/python2.3/site-packages/_xmlplus/sax/expatreader.py", line 109, in parse
>     xmlreader.IncrementalParser.parse(self, source)
>   File "/usr/lib/python2.3/site-packages/_xmlplus/sax/xmlreader.py", line 125, in parse
>     self.close()
>   File "/usr/lib/python2.3/site-packages/_xmlplus/sax/expatreader.py", line 226, in close
>     self.feed("", isFinal = 1)
>   File "/usr/lib/python2.3/site-packages/_xmlplus/sax/expatreader.py", line 220, in feed
>     self._err_handler.fatalError(exc)
>   File "/usr/lib/python2.3/site-packages/_xmlplus/sax/handler.py", line 38, in fatalError
>     raise exception
> xml.sax._exceptions.SAXParseException: <unknown>:4298:10: unclosed token
> but the xml file looks ok, it can be visualized in a web browser without any problem. Does anybody know what is going on?

Which version of PyXML do you have installed?
How are you parsing the file? (let's see the Python code)
Can you point us to the XML file?

More information about the XML-SIG mailing list