XML文档:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>name</key> <string>名字</string>
</dict>
</array>
</plist>
解析:
ValueVector p_map = FileUtils::getInstance()->getValueVectorFromFile(xml Flie);
ValueMap map=p_map.at(0).asValueMap();
string str=map.at("name").asString();
使用过程中没有问题 希望对你有帮助
======== 文档开头是array的要用ValueVector接收,是Dict开头的采用ValueMap接收