Problem compiling to use

Hi.

I’m preparing a XMLManager to read and store data, using CCSAXParser, based on libxml2.

Basically, i follow This:

http://www.siddhanttewari.com/site/

tutorial, and cocos2d-x class reference:

http://www.cocos2d-x.org/reference/native-cpp/d5/d48/classcocos2d\_1\_1\_c\_c\_s\_a\_x\_parser.html

I create a delegate:

CCSAXDelegator * _delegate; // Delegate to set CCSAX class

I use init parsing:

/*
>
First step to read a XML File
/
bool XMLManager::initParsing
{
CCSAXParser parser;
>
// Check if UTF-8 format
if )
{
CCLog;
return false; // Format no valid
}
>
// Set delegate
parser.setDelegator;
>
// Create var with path
const char
xmlPath = CCFileUtils::fullPathFromRelativePath(“LanguageSpanish.xml”);
>
// Parse Data
parser.parse(xmlPath);
>
return true; // OK
}

But, compiling i get this error:

XMLManager.cpp:51: error: cannot call member function ‘const char* cocos2d::CCFileUtils::fullPathFromRelativePath(const char*)’ without object

Is some problem with last cocos2d-x stable version or i`m doing something wrong?

Thanks in advance.

Hi, problem is in how you access fileutils, API was changed.
Use this:
const char *xmlPath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(“LanguageSpanish.xml”);
Petr

That solve the problem, thanks.

Well, that solve compilation problem, but i have no idea how to read info from XML.

Someone could help?

Libxml2 has no tutorials on http://www.xmlsoft.org/, only some examples. This is madness, maybe is simple to use but i can not do it.

There is ccuserdefaults.cpp in cocos2d-x sources (find files around user defaults), in this file you can see how cocos work with xml.