You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2004/03/26 16:37:42 UTC

DO NOT REPLY [Bug 27963] - setAttribute duplicates an attribute with an empty value instead of replacing it

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27963>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27963

setAttribute duplicates an attribute with an empty value instead of replacing it





------- Additional Comments From mp49@kent.ac.uk  2004-03-26 15:37 -------
On repoducing this behaviour:

This must be cause because of the binary search in the NamedNodeMapImpl.

The findNamePoint() in NamedNodeMapImpl performs a binary search based on the
name of the node returned by getNodeName(), which returns the namespace prefix
and the local name.

However, it seems that the attributes in an element are ordered according to the
local name. E.g. the serialisation of the element that caused this bug is:

<el1 attr1="8.0" uri1:attr2="!8.0" attr2="2.0" attr3="!2" attr4=""
xmlns:uri1="uri1">

When I try to set the value of "attr4", the binary search seems to stop after
seeing the "uri1:attr2" attribute because 'u' > 'a' and therefore it adds the a
new attribute with the same name.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org