c++ xml库相关

要解析内容:

<ITEM name="SLSJ"head="SLSJ"/>

代码:

GetNodeAttri(subnodes[i],"head");

 

函数代码:

xmlChar *xstr;

string prop,value;

xmlAttrPtr p_attr = node->properties;

while(p_attr)

{

prop = (char *)p_attr->name;

xstr = xmlGetProp(node,p_attr->name);

value = (char*)xstr;

xmlFree(xstr);

attris.insert(make_pair(prop,value));

p_attr = p_attr->next;

}

问题:引号后不能直接跟值否则会解析错误

posted on 2017-03-23 19:51  baraka  阅读(160)  评论(0编辑  收藏  举报