URL:
  <http://gna.org/bugs/?11991>

                 Summary: XmlReader::ReadString goes recursively in the tree
                 Project: Wormux
            Submitted by: gentildemon
            Submitted on: mercredi 09.07.2008 à 22:31
                Category: None
                Severity: 4 - Important
                Priority: 5 - Normal
                  Status: None
             Assigned to: kurosu
        Originator Email: 
             Open/Closed: Open
                 Release: 0.8svn
         Discussion Lock: Any

    _______________________________________________________

Details:

How to view the bug:
Display the game menu. Instead of the name of the map, the first thing
display under the map is the author name. This is the result of a wrong read
of the XML file.

Info displayed are loaded from InfoMap::ProcessXmlData in
src/map/maps_list.cpp

Small extract of the code:
xmlNode *author = XmlReader::GetMarker(xml, "author");
if (author != NULL) {
         XmlReader::ReadString(author, "name", a_name);
         ...
}
XmlReader::ReadString(xml, "name", name);

Extract of a XML file:
<resources>
  <author>
    <name>Anthony CARRÉ</name>
    ...
  </author>
  ...
  <name>Island</name>
  ...
</resources>

The result is a_name contains "Anthony CARRÉ" as expected, but name contains
"Anthony CARRÉ" instead of "Island".

If <name>Island</name> is written before <author><name>..., everything
works.

So, ReadString goes recursively to find the awaited keyword, that is not the
expected behavior!!





    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?11991>

_______________________________________________
  Message posté via/par Gna!
  http://gna.org/


_______________________________________________
Wormux-gna mailing list
[email protected]
https://mail.gna.org/listinfo/wormux-gna

Reply via email to