Re: [xml] Normalization Query
- From: Daniel Veillard <veillard redhat com>
- To: Ashwin <ashwins huawei com>
- Cc: xml gnome org, ranjit huawei com
- Subject: Re: [xml] Normalization Query
- Date: Wed, 27 Aug 2008 14:11:57 +0200
On Fri, Apr 18, 2008 at 04:10:29PM +0800, Ashwin wrote:
----Original Message-----
From: xml-bounces gnome org [mailto:xml-bounces gnome org] On Behalf Of
Daniel Veillard
Sent: 2008å3æ26æ 0:55
To: Ashwin
Cc: xml gnome org; ranjit huawei com
Subject: Re: [xml] Normalization Query
On Wed, Mar 19, 2008 at 10:15:15AM +0530, Ashwin wrote:
The confusion is exarcebated by the fact that Java based parsers are doing
Normalization which returns values which I have mentioned that are
contrary
to what is being returned by libxml..
I do not know whether I am interpreting the spec wrongly, so any
clarifications regarding the same would be extremely welcome.
No that was libxml2 bugs :-\ . They were a bit hard to fix, but hopefully
they are fixed in SVN, could you please checkout and rerun your tests.
I have tried to include your examples in the regression suite, and also
fixed the over normalization issue you raised earlier.
I hope this is fine now,
Thanks for the fixes!!!
However there seems to be a slight problem in xmlAttrNormalizeSpace2...
When this function is called in xmlParseAttribute2..
val2 = xmlAttrNormalizeSpace2(ctxt, val, len);
if (val2 != NULL) {
xmlFree(val); // Here if only leading spaces are present
val = val2; //xmlAttrNormalizeSpace2 returns the pointer to the first
char after the leading spaces, so in this case val2
will point to the same memory as val except it will be
ahead by the number of whitespaces....
So freeing val will in effect free val2 as well, and thus will lead to
problems.
I am attaching a patch which takes care of the problem. Please let me know
if this is ok.
As you can see i'm checking my old mail, yes i found the problem too
probably using the same test suite, but fixed it in a simpler way which
didn't need a new allocation, just with a memmove, see at the bottom of
xmlAttrNormalizeSpace2 in CVS,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]