- 論壇徽章:
- 0
|
<div style="text-align: center;"><font class="Apple-style-span" size="5">libxml學(xué)習(xí)<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),結(jié)點(diǎn)指針(xmlNodePtr);<br style="line-height: normal;">2 得到文檔doc: xmlReadFile<br style="line-height: normal;">3 得到根結(jié)點(diǎn)root_node:xmlDocGetRootElement<br style="line-height: normal;">4 結(jié)點(diǎn)操作:<br style="line-height: normal;"> 1)獲得到結(jié)點(diǎn)值: xmlNodeGetContent(對(duì)應(yīng)于xmlFree)<br style="line-height: normal;"> 2)遍歷:<br style="line-height: normal;"> 指向下一個(gè)結(jié)點(diǎn):xmlNodePtr ->children<br style="line-height: normal;"> 結(jié)點(diǎn)值:xmlNodePtr->name,<br style="line-height: normal;"> 結(jié)點(diǎn)內(nèi)遍歷:xmlNodePtr->next<br style="line-height: normal;">5 釋放內(nèi)存:xmlFreeDoc,xmlFree</span> <br></font><font class="Apple-style-span" size="5"><br> </font></div></div> |
|