Assimp  v4.1. (December 2018)
/build/assimp-xnSILf/assimp-4.1.0~dfsg/contrib/irrXML/irrXML.h

irrXML is intended to be a high speed and easy-to-use XML Parser for C++, and this documentation is an important part of it. If you have any questions or suggestions, just send a email to the author of the engine, Nikolaus Gebhardt (niko (at) irrlicht3d.org). For more informations about this parser, see History.

Features

irrXML provides forward-only, read-only access to a stream of non validated XML data. It was fully implemented by Nikolaus Gebhardt. Its current features are:

Although irrXML has some strenghts, it currently also has the following limitations:

Example

The following code demonstrates the basic usage of irrXML. A simple xml file like this is parsed:

<?xml version="1.0"?>
<config>
<!-- This is a config file for the mesh viewer -->
<model file="dwarf.dea" />
<messageText caption="Irrlicht Engine Mesh Viewer">
Welcome to the Mesh Viewer of the &quot;Irrlicht Engine&quot;.
</messageText>
</config>

The code for parsing this file would look like this:

#include <irrXML.h>
using namespace irr; // irrXML is located in the namespace irr::io
using namespace io;
#include <string> // we use STL strings to store data in this example
void main()
{
// create the reader using one of the factory functions
IrrXMLReader* xml = createIrrXMLReader("config.xml");
// strings for storing the data we want to get out of the file
std::string modelFile;
std::string messageText;
std::string caption;
// parse the file until end reached
while(xml && xml->read())
{
switch(xml->getNodeType())
{
case EXN_TEXT:
// in this xml file, the only text which occurs is the messageText
messageText = xml->getNodeData();
break;
{
if (!strcmp("model", xml->getNodeName()))
modelFile = xml->getAttributeValue("file");
else
if (!strcmp("messageText", xml->getNodeName()))
caption = xml->getAttributeValue("caption");
}
break;
}
}
// delete the xml parser after usage
delete xml;
}

How to use

   Simply add the source files in the /src directory of irrXML to your project. Done.

License

   The irrXML license is based on the zlib license. Basicly, this means you can do with
   irrXML whatever you want:

   Copyright (C) 2002-2005 Nikolaus Gebhardt

   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   arising from the use of this software.

   Permission is granted to anyone to use this software for any purpose,
   including commercial applications, and to alter it and redistribute it
   freely, subject to the following restrictions:

   1. The origin of this software must not be misrepresented; you must not
    claim that you wrote the original software. If you use this software
    in a product, an acknowledgment in the product documentation would be
    appreciated but is not required.

   2. Altered source versions must be plainly marked as such, and must not be
    misrepresented as being the original software.

   3. This notice may not be removed or altered from any source distribution.

History

   As lots of references in this documentation and the source show, this xml 
   parser has originally been a part of the 
   <A HREF="http://irrlicht.sourceforge.net" >Irrlicht Engine</A>. But because
   the parser has become very useful with the latest release, people asked for a 
   separate version of it, to be able to use it in non Irrlicht projects. With
   irrXML 1.0, this has now been done.

~dfsg/contrib/irrXML/irrXML.h