What is wrong? The minidom or the XML file?

Anthony Liu antonyliu2002 at yahoo.com
Wed Mar 10 17:42:16 CET 2004


Yes, you are right, Erik.  The xml document was
successfully parsed by lower-casing XML and removing
the ampersand in the document.

Another question: If I insert some Chinese characters
in the sample xml document, then again the same python
code cannot parse it. It python code got choked
whenever it hits the 1st Chiese character.

Python says:

ExpatError: not well-formed (invalid token): line 3,
column 7

The problem remains even if I try encoding="UTF-16" or
encoding="GB2312" or encoding="GBK" in the xml
document.

Note that GB2312 and GBK are Chinese encodings.

Please give a hint.  Thanks a lot!

--- Erik Max Francis <max at alcyone.com> wrote:
> Anthony Liu wrote:
> 
> > <?XML version="1.0" encoding="UTF-8"?>
>       ^
> 	...
> > ExpatError: not well-formed (invalid token): line
> 1,
> > column 5
> 
> Line 1 column 5 is the L in <?XML.  That XML
> document type declaration
> is invalid; the "XML" needs to be in lowercase.
> 
> -- 
>  __ Erik Max Francis && max at alcyone.com &&
> http://www.alcyone.com/max/
> /  \ San Jose, CA, USA && 37 20 N 121 53 W &&
> &tSftDotIotE
> \__/ It's like being on a diving board that you know
> is too high.
>     -- Sade Adu
> -- 
> http://mail.python.org/mailman/listinfo/python-list


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com




More information about the Python-list mailing list