[[ArchivePage]]
= XML-Loader =
The 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.
== XML-Design ==
See [wiki:content/LevelHowTo] (don't know if this is still up to date...)
== Ticket ==
This page referrers to [ticket:232 Ticket 232] which is maintained by [wiki:people/NicolasPerrenoud Nicolas Perrenoud]
== Library ==
I'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]).
It uses only one class, which is defined in xmlParser.cpp, xmlParser.h
The class '''XMLNode''' reflects an Node in the XML-File. It has methods to get the child nodes, get the attributes and inner text.
'''Example:'''
Lorem Ipsum dolor sit amet
'''XMLNode xMainNode=XMLNode::openFileHelper("level.xml","root");''' // This loads the xml file and defines root as the main node
'''XMLNode xNode=xMainNode.getChildNode("level");''' // This creates a new node object of child node
'''cout << xNode.getAttribute("name");''' // This prints the value xNode's attribute name, in this case ''Argon Prime''
'''cout << xNode.getText());''' // This prints the inner content of xNode, in this case ''Lorem Ipsum dolor sit amet''
== Misc ==
See [wiki:XML-Writer] for an XML-Writer description