• 5073阅读
  • 2回复

qt如何读取这样的xml [复制链接]

上一主题 下一主题
离线zzxap
 

只看楼主 倒序阅读 楼主  发表于: 2011-03-16
[font='ar]<xmlversion="1.0"encoding="utf8">
<ConfigFilePath>
<Section Name="Setting"  GroupName="4" >
<Key Enc="E3493797F035460FA5B619456E3A4AE4"  Value="http://www.vv.com/2/4/4/Setting.cnf"    size="896"/>
</Section>


</ConfigFilePath> 读取Section节点 name="Secting"  中的value  size Enc 三个属性值
[ 此帖被zzxap在2011-03-16 10:10重新编辑 ]
离线浪漫天使
只看该作者 1楼 发表于: 2011-03-16
QDomNode
attributes();

看文档
离线luckbug

只看该作者 2楼 发表于: 2011-03-17
QDomDocument doc;
doc.setContent(buffer,true);//buffer为XML
QDomElement root = doc.documentElement();;
QDomElement config_file_path = root.firstChildElment("Section");
QString  name = config_file_path.attribute("Name");//Name
。。。。。。。。。。。。。。。。。。。。。。。。
快速回复
限100 字节
 
上一个 下一个