How to parse xml files in jsbinding[cocos2d-x]?

How to parse xml files in jsbinding[cocos2d-x]?

I will use javascript to parse xml files and this project will run in ios and android.

cocos2d-html5 can use CCSAXParse to parse xml.

I copy CCSAXParse.js to cocos2d-x and try to use it to parse xml file but faild.

It says “ReferenceError: window is not defined”.

What should I do?

It’s not supported now. You could do it in CPP, then bind it to JS.

Thanks.I get it.
Maybe I can use regex to do it.

JSB now supports to parse plist file now.
Please refer to PR https://github.com/cocos2d/cocos2d-x/pull/3236
The API is cc.FileUtils.getInstance().createDictionaryWithContentsOfFile(plist_filename);
Cocos2d-HTML5 will also support this API soon.
Thanks.