Menu

Problem with two identical Attributs

Developer
Kainz
2004-08-03
2004-08-04
  • Kainz

    Kainz - 2004-08-03

    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;  <<<<
    }

     
    • Ellers

      Ellers - 2004-08-04

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

       
      • Kainz

        Kainz - 2004-08-04

        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

         

Log in to post a comment.

MongoDB Logo MongoDB