You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Juan Grigera <jg...@pombero.biophnet.unlp.edu.ar> on 2000/12/28 19:13:33 UTC

BUG: removeitem+clone

Hi,

Unless I am misusing the DOM functions, I found a bug:
#        domelement.removeAttribute("id");

leaves NodeVector in an invalid state if "id" is the only or the last
attribute in the node, thus if you try, say to clone it

#	DOM_Node cloned = domelement.cloneNode(true);
yields
#       NodeVector.cpp:109: void NodeVector::init(unsigned int): Assertion 
`size > 0' failed.

(I am on Xerces-C 1.3.0, linux-gcc)

regards,

Juan 


Re: BUG: removeitem+clone - Fix

Posted by Khaled Noaman <kn...@ca.ibm.com>.
The attached patch fixes the clone problem.

Regards,
Khaled Noaman
XML Parser Dev.- IBM Toronto Lab
knoaman@ca.ibm.com

Khaled Noaman wrote:

> Juan,
>
> You're right, you've found a bug. The removeAttribute works fine, it
> is more on the clone side. I will propose a patch and let you know.
>
>
> Regards,
> Khaled Noaman
> XML Parser Dev.- IBM Toronto Lab
> knoaman@ca.ibm.com
>
> Juan Grigera wrote:
>
>> Hi,
>>
>> Unless I am misusing the DOM functions, I found a bug:
>> #        domelement.removeAttribute("id");
>>
>> leaves NodeVector in an invalid state if "id" is the only or the
>> last
>> attribute in the node, thus if you try, say to clone it
>>
>> #       DOM_Node cloned = domelement.cloneNode(true);
>> yields
>> #       NodeVector.cpp:109: void NodeVector::init(unsigned int):
>> Assertion
>> `size > 0' failed.
>>
>> (I am on Xerces-C 1.3.0, linux-gcc)
>>
>> regards,
>>
>> Juan
>>
>> ----
>> ----------------------------------------------------------------
>> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>

Re: BUG: removeitem+clone

Posted by Khaled Noaman <kn...@ca.ibm.com>.
Juan,

You're right, you've found a bug. The removeAttribute works fine, it is more
on the clone side. I will propose a patch and let you know.


Regards,
Khaled Noaman
XML Parser Dev.- IBM Toronto Lab
knoaman@ca.ibm.com

Juan Grigera wrote:

> Hi,
>
> Unless I am misusing the DOM functions, I found a bug:
> #        domelement.removeAttribute("id");
>
> leaves NodeVector in an invalid state if "id" is the only or the last
> attribute in the node, thus if you try, say to clone it
>
> #       DOM_Node cloned = domelement.cloneNode(true);
> yields
> #       NodeVector.cpp:109: void NodeVector::init(unsigned int): Assertion
> `size > 0' failed.
>
> (I am on Xerces-C 1.3.0, linux-gcc)
>
> regards,
>
> Juan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org