Re: [xml] Normalization Query





 

----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.

Regards
Ashwin 
   

Attachment: patch.txt
Description: Text document



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]