What is wrong? The minidom or the XML file?
antonyliu2002 at yahoo.com
Thu Mar 11 02:26:00 CET 2004
What do you mean by "where these Chinese characters
come from"? I think I got lost.
--- Erik Max Francis <max at alcyone.com> wrote:
> Anthony Liu wrote:
> > Another question: If I insert some Chinese
> > in the sample xml document, then again the same
> > 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
> > 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.
> If you're getting errors, then the encoding
> specified in the XML
> document type declaration doesn't patch what you've
> pasted in. It
> matters where these Chinese characters come from,
> since they're going to
> be a part of some encoding and you haven't said what
> it was; if your
> document is UTF-8, you need to paste UTF-8 in.
> __ Erik Max Francis && max at alcyone.com &&
> / \ San Jose, CA, USA && 37 20 N 121 53 W &&
> \__/ Love is the true price of love.
> -- George Herbert
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster
More information about the Python-list