- 论坛徽章:
- 0
|
<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: xmlReadFile<br style="line-height: normal;">3 得到根结点root_node:xmlDocGetRootElement<br style="line-height: normal;">4 结点操作:<br style="line-height: normal;"> 1)获得到结点值: xmlNodeGetContent(对应于xmlFree)<br style="line-height: normal;"> 2)遍历:<br style="line-height: normal;"> 指向下一个结点:xmlNodePtr ->children<br style="line-height: normal;"> 结点值:xmlNodePtr->name,<br style="line-height: normal;"> 结点内遍历:xmlNodePtr->next<br style="line-height: normal;">5 释放内存:xmlFreeDoc,xmlFree</span> <br></font><font class="Apple-style-span" size="5"><br> </font></div></div> |
|