[xml] libxml 2.2.0 xmlParseMemory bug

Date view Thread view Subject view Author view

From: David Kågedal (davidk@lysator.liu.se)
Date: Fri Jul 21 2000 - 06:37:08 EDT


Someone else noticed that xmlParseMemory got character encodings
wrong, and I can only confirm this.

I have the following small XML document:

<?xml version="1.0" encoding="iso-8859-1"?>
<test att="räka">ohåj <börje/></test>

And the attached program which tries both xmlParseFile and
xmlParseMemory, and fails on the latter. The output is also attached.

It it a bit unclear to me how I should detect that the parse failed,
since xmlParseMemory returns a valid (almost, it had doc->charset set
to 10 instead of 1) document pointer. I missed that it wrote to stderr
in my real program, since that was in a server whose stderr I didn't
look at. How the heck am I supposed to know that the parse failed,
when I can't get at the parser context, which is the only place where
the error is indicated?

In a way it doesn't fail, since it produces a document tree, with
latin-1 encoded data, but libxml 2.2.0 isn't supposed to do that.

Also, I would like to be able to disable the stderr printing, but that
might already be possible, I haven't really looked yet.



-- 
David Kågedal

---- Message from the list xml@xmlsoft.org Archived at : http://xmlsoft.org/messages/ to unsubscribe: echo "unsubscribe xml" | mail majordomo@xmlsoft.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:30:24 EDT