xml.dom.minidom - parseString - How to avoid ExpatError?
gregpinero at gmail.com
Wed Oct 26 16:38:23 CEST 2005
Should I try some sort of XML group instead? I'm still stuck on this.
On 10/25/05, Gregory Piñero <gregpinero at gmail.com> wrote:
> Hi guys,
> I was hoping some XML expert could help me make this code work. Below is
> sample code with sample XML similar to what I'm dealing with.
> How can I make the weird characters in the XML not break the parser? I'll
> do anything to make this work!
> (Note: the broke my parser yesterday but doesn't seem to in this
> sample code) But really I'm looking for solutions that will handles lots
> of unusual characters.
> Much thanks,
> from xml.dom.minidom import parseString
> This is sample problem text. £500.00
> Traceback (most recent call last):
> line 307, in RunScript
> debugger.run(codeObject, __main__.__dict__, start_stepping=0)
> File "C:\Python23\Lib\site-packages\pythonwin\pywin\debugger\__init__.py",
> line 60, in run
> _GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
> File "C:\Python23\Lib\site-packages\pythonwin\pywin\debugger\debugger.py",
> line 631, in run
> exec cmd in globals, locals
> File "C:\Documents and Settings\Gregory\My Documents\Python\xml
> help\xmlproc.py", line 9, in ?
> File "C:\Python23\lib\xml\dom\minidom.py", line 1929, in parseString
> return expatbuilder.parseString(string)
> File "C:\Python23\lib\xml\dom\expatbuilder.py", line 940, in parseString
> return builder.parseString(string)
> File "C:\Python23\lib\xml\dom\expatbuilder.py", line 223, in parseString
> parser.Parse(string, True)
> ExpatError: undefined entity: line 4, column 29
> Gregory Piñero
> Chief Innovation Officer
> Blended Technologies
> (www.blendedtechnologies.com <http://www.blendedtechnologies.com>)
Chief Innovation Officer
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list