If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
carlwryker
Posts: 22 Joined: Sun Jun 12, 2016 8:03 am
Post
by carlwryker » Sat Sep 17, 2016 9:55 pm
I made an xml file that looks something like the following. The elements style was more suitable for my project than the attributes style.
Code: Select all
<?xml version="1.0"?>
<EdSpeciesVec>
<EdSpecies>
<id>1</id>
<name>A</name>
<desc>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</desc>
<thumbTexId>-1</thumbTexId>
<bloodTexId>-1</bloodTexId>
<notes> </notes>
</EdSpecies>
/* more <EdSpecies></EdSpecies> blocks */
</EdSpeciesVec>
Is getNodeData() used to read the data between element tags? Where can I find an example of how it is used?
Code::Blocks
mingw
Windows 10 64-bit
CuteAlien
Admin
Posts: 9734 Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:
Post
by CuteAlien » Mon Sep 19, 2016 10:38 am
Yeah, getNodeData is used for that.I don't have time to write a real example right not, but should be something like:
Code: Select all
while(xml && xml->read())
{
switch(xml->getNodeType())
{
case irr::io::EXN_CDATA:
{
const wchar_t * data = xml->getNodeData(); // data inside elements
}
break;
case irr::io::EXN_ELEMENT:
{
const wchar_t * name= xml->getNodeName(); // element node name
}
break;
// not sure if you need other types - check docs which other types exist
}
}
carlwryker
Posts: 22 Joined: Sun Jun 12, 2016 8:03 am
Post
by carlwryker » Mon Sep 19, 2016 3:29 pm
Thank you!
Code::Blocks
mingw
Windows 10 64-bit