Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Initial Version and Version 1 of ~archive/XML-Loader


Ignore:
Timestamp:
Aug 22, 2011, 2:19:45 PM (13 years ago)
Author:
landauf
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ~archive/XML-Loader

    v1 v1  
     1= XML-Loader =
     2
     3The goal of the XML-Loader is to import levels defined in an XML-File into the game engine. This is done by parsing a specified XML-File and adding all defined Entities for the Scene-Manager.
     4
     5== XML-Design ==
     6
     7See [wiki:LevelHowTo] (don't know if this is still up to date...)
     8
     9== Ticket ==
     10
     11This page referrers to [http://www.orxonox.net/ticket/232 Ticket 232] which is maintained by [http://www.orxonox.net/wiki/NicolasPerrenoud Nicolas Perrenoud]
     12
     13== Library ==
     14
     15I'm using the [http://iridia.ulb.ac.be/~fvandenb/tools/xmlParser.html xmlParser] Library from Frank Vanden Berghen which is small, simple to use and fast. ([http://www.applied-mathematics.net/download.php?id=43 Download]).
     16It uses only one class, which is defined in xmlParser.cpp, xmlParser.h
     17The class '''XMLNode''' reflects an Node in the XML-File. It has methods to get the child nodes, get the attributes and inner text.
     18
     19'''Example:'''
     20
     21<root>
     22  <level name="Argon Prime">
     23    Lorem Ipsum dolor sit amet
     24  </level>
     25</root>
     26
     27'''XMLNode xMainNode=XMLNode::openFileHelper("level.xml","root");''' // This loads the xml file and defines root as the main node
     28
     29'''XMLNode xNode=xMainNode.getChildNode("level");''' // This creates a new node object of child node <level>
     30
     31'''cout << xNode.getAttribute("name");''' // This prints the value xNode's attribute name, in this case ''Argon Prime''
     32
     33'''cout << xNode.getText());''' // This prints the inner content of xNode, in this case ''Lorem Ipsum dolor sit amet''
     34
     35== Misc ==
     36
     37See [wiki:archive/XML-Writer] for an XML-Writer description
     38
     39