Lance Gray wrote:
What version are you using? If you’re using 2.0.3 (I think) it has been changed to whatever you pass it. For example
cocos2d::CCLog("xml file name is %s", CCFileUtils::fullPathFromRelativePath("a.xml") ); would print “xml file name is /a.xml” or something.
You should supply the correct path if you are using folder structures (like Resources/Data/a.xml). So instead of just passing “a.xml”, pass “Data/a.xml” instead.
I use tinyxml for parse xml file. this is my code. I can not read file
m_pXMLDoc = new TiXmlDocument( CCFileUtils::fullPathFromRelativePath(“a.xml”) );
bool bFlag = m_pXMLDoc->LoadFile();
cocos2d::CCLog(“The xml file loaded failed”);
cocos2d::CCLog(“xml file name is %d”, bFlag);