I had a problem using two identical Attributs within one XML-Element (I know, it's not practical). Guess there's a little bug in tinyxmlparser.cpp @ line 1100 (version 2.3.2) where should be a "break" instead of a "return 0".
// Handle the strange case of double attributes:
TiXmlAttribute* node = attributeSet.Find(attrib->Name() );
Only because XML-spec said it can't be, this should not drive to a parsing error. There are other non-XML spec checks (p.e. attribute values without ' or ") that - in my opinion - are still less conform.
Anyway: You're all right, the XML spec said there can't be two attributes with the same name.
What I'm confused about: There is already an if-Statement in the parsing function which handles the case of multiple same-named attributes that (I think) didn't work well.
Bazi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had a problem using two identical Attributs within one XML-Element (I know, it's not practical). Guess there's a little bug in tinyxmlparser.cpp @ line 1100 (version 2.3.2) where should be a "break" instead of a "return 0".
// Handle the strange case of double attributes:
TiXmlAttribute* node = attributeSet.Find(attrib->Name() );
if ( node )
{
node->SetValue( attrib->Value() );
delete attrib;
>>>> return 0; <<<<
}
I thought the XML spec said you can't have two attributes of the same name in the one node? I don't have it handy to check tho...
Only because XML-spec said it can't be, this should not drive to a parsing error. There are other non-XML spec checks (p.e. attribute values without ' or ") that - in my opinion - are still less conform.
Anyway: You're all right, the XML spec said there can't be two attributes with the same name.
What I'm confused about: There is already an if-Statement in the parsing function which handles the case of multiple same-named attributes that (I think) didn't work well.
Bazi