I have spent hours and cannot get things going. I use TiXmlDocument::Parse(…) to parse the xml below. I cannot for the life of me figure out how to read the sub items like triggerPriceBuy .
My xml:
<Parameters> <active>true</active> <triggerPriceBuy>0.45</triggerPriceBuy> <triggerPriceSell>-0.50</triggerPriceSell> </Parameters>
My code is: TiXmlElement* pElem; TiXmlDocument doc; doc.Parse( data_ ); pElem=hDoc.FirstChildElement().Element(); printf(pElem->Value()); // Prints Parameters //enters once with pKey equalling "Parameters" for( pElem; pElem; pElem=pElem->NextSiblingElement()) { const char *pKey=pElem->Value(); const char *pText=pElem->GetText(); }
Log in to post a comment.
I have spent hours and cannot get things going. I use TiXmlDocument::Parse(…) to parse the xml below. I cannot for the life of me figure out how to read the sub items like triggerPriceBuy .
My xml:
<Parameters>
<active>true</active>
<triggerPriceBuy>0.45</triggerPriceBuy>
<triggerPriceSell>-0.50</triggerPriceSell>
</Parameters>
My code is:
TiXmlElement* pElem;
TiXmlDocument doc;
doc.Parse( data_ );
pElem=hDoc.FirstChildElement().Element();
printf(pElem->Value()); // Prints Parameters
//enters once with pKey equalling "Parameters"
for( pElem; pElem; pElem=pElem->NextSiblingElement())
{
const char *pKey=pElem->Value();
const char *pText=pElem->GetText();
}