xml reader

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
emadof85
Posts: 31
Joined: Sun May 25, 2014 6:10 pm

xml reader

Post by emadof85 »

Code: Select all

 
<library_images>
    <image id="img-1805801772">
      <init_from>textures\683521268.jpg</init_from>
    </image>
    <image id="img-1539403413">
      <init_from>textures\512724919.jpg</init_from>
    </image>
</library_images>
 
i use this code

Code: Select all

void parser :: readImages(irr::io::IXMLReader* xml,image img) 
{
    while(xml && xml->read())
    {
        const irr::core::stringw name = xml->getNodeName();
 
        switch (xml->getNodeType())
        {
        case irr::io::EXN_ELEMENT_END:
            if (irr::core::stringw(L"library_images")==name)
            {
                return;
            }
            break;
        case irr::io::EXN_ELEMENT:
            if (irr::core::stringw(L"image")==name)
            {
                core::stringw id1 = xml->getAttributeValueSafe(L"id");
                img.id = id1;
            }
            if (irr::core::stringw(L"init_from")==name)
            {
                ?????????????????
            }
                
            
            
            break;
        default:
            break;
        }
    }
}
how can i get the text after<init_from> , i put ?????????????? instead the code
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: xml reader

Post by Klunk »

just ignore me :D
emadof85
Posts: 31
Joined: Sun May 25, 2014 6:10 pm

Re: xml reader

Post by emadof85 »

ignore what ?
i want to get the text (textures\683521268.jpg) from the xml file
Christi258
Posts: 62
Joined: Wed Feb 06, 2013 12:11 pm

Re: xml reader

Post by Christi258 »

Did you try xml->getNodeData() ?
emadof85
Posts: 31
Joined: Sun May 25, 2014 6:10 pm

Re: xml reader

Post by emadof85 »

yes xml->getNodeData() return (init_from)
Post Reply