It's not clear if two element attributes with the same name are allowed or not.
On one side, there is no error set and even the value is changed to the new one, but on the other side the function is immediately aborted and the return code is 0 (i.e. failure if called from TiXmlElement::ReadValue()).
If attributes with the same name are allowed, the parser should continue with the remaining attributes.
Therefore, the return 0; command should be replaced by the continue; command.
Sourcecode:
// Handle the strange case of double attributes:
#ifdef TIXML_USE_STL
TiXmlAttribute* node = attributeSet.Find( attrib->NameTStr() );
#else
TiXmlAttribute* node = attributeSet.Find( attrib->Name() );
#endif
if ( node )
{
node->SetValue( attrib->Value() );
delete attrib;
return 0;
}
attributeSet.Add( attrib );
}
Double attributes are now allowed in XML. Adding error handling.