Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, I have an XML file that looks like this: <Environment> <Viewport Color="0,128,192" Fov="0" NearClip="-0.000000" FarClip="0.000000" /> </Environment> How do I get the pointer to child node? I have this so far syntax but it seems not to work:( Thank u. while(xml && xml->read()) { If (xml->GetNodeName()=="Environment") { If (xml->GetNodeName()=="Viewport") { std::string EnvColor = xml->getAttributeValue("Color"); std::string EnvFov = xml->getAttributeValue("Fov"); std::string EnvNearClip = xml->getAttributeValue("NearClip"); std::string EnvFarClip = xml->getAttributeValue("FarClip"); } } } |
||||
|
What you want to do is this: while (xml && xml->read()) Only 1 node can be the active node at a time. For your <environment> </environment> tags, you could set a boolean environment variable to true if you need to, but since they contain no data items you might as well ignore them. |
||||
|
h i see. Thanks It worked great. |
|