Page 1 of 1

How is 'irr::io::IIrrXMLReader::getNodeData()' used?

Posted: Sat Sep 17, 2016 9:55 pm
by carlwryker
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?

Re: How is 'irr::io::IIrrXMLReader::getNodeData()' used?

Posted: Mon Sep 19, 2016 10:38 am
by CuteAlien
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
    }
}
 

Re: How is 'irr::io::IIrrXMLReader::getNodeData()' used?

Posted: Mon Sep 19, 2016 3:29 pm
by carlwryker
Thank you!