类结构

XMLNode指的是所有被<…>…</…>包括的内容, 具体有声明, 注释, 节点及节点间的文本.
例如:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
260. 整个文档为XMLDocument
1. 下面为XMLDeclaration
xml version="1.0" encoding="UTF-8"
2. 一个<phonebook>...</phonebook>是一个XMLElement
<phonebook>
3. XMLComment
<!--one item behalfs one contacted person.-->
4. 一个<item>是一个XMLElement;
5. item中的name="1"是一个XMLAttribute
<item name="1">
5. item中的<name>也是一个XMLElement
6. <name>与</name>之间的是一个XMLText
<name>miaomaio</name>
<addr>Shaanxi Xi'an</addr>
<tel>13759911917</tel>
<email>miaomiao@home.com</email>
</item>
<item name="2">
<name>gougou</name>
<addr>Liaoning Shenyang</addr>
<tel>15840330481</tel>
<email>gougou@home.com</email>
</item>
3. 下面为XMLComment
<!--more contacted persons.-->
</phonebook>
写的例子
1 | bool writexmlfile() { |
读的例子
1 | bool readxmlfile() { |