免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1493 | 回复: 0
打印 上一主题 下一主题

libxml学习 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-23 02:32 |只看该作者 |倒序浏览
<div style="text-align: center;"><font class="Apple-style-span" size="5">libxml学习<br></font><br><div style="text-align: left; "><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: Arial; line-height: 20px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; ">1 声明指针:文档指针(xmlDocPtr),结点指针(xmlNodePtr);<br style="line-height: normal;">2 得到文档doc: &nbsp;xmlReadFile<br style="line-height: normal;">3 得到根结点root_node:xmlDocGetRootElement<br style="line-height: normal;">4 结点操作:<br style="line-height: normal;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1)获得到结点值: xmlNodeGetContent(对应于xmlFree)<br style="line-height: normal;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2)遍历:<br style="line-height: normal;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 指向下一个结点:xmlNodePtr -&gt;children<br style="line-height: normal;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 结点值:xmlNodePtr-&gt;name,<br style="line-height: normal;">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 结点内遍历:xmlNodePtr-&gt;next<br style="line-height: normal;">5 释放内存:xmlFreeDoc,xmlFree</span>&nbsp;<br></font><font class="Apple-style-span" size="5"><br>&nbsp;&nbsp;&nbsp;</font></div></div>
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP