前端之家收集整理的这篇文章主要介绍了
XML小练习(一),
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE students
[
<!ELEMENT students (student*)>
<!ELEMENT student (name+,class+,number+,duty*,sex+,hometown?)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT class (#PCDATA)>
<!ELEMENT number (#PCDATA)>
<!ELEMENT duty (#PCDATA)>
<!ELEMENT sex (#PCDATA)>
<!ELEMENT hometown (province?,city?)>
<!ELEMENT province (#PCDATA)>
<!ELEMENT city (#PCDATA)>
]>
<students>
<student>
<name>张三</name>
<class>1406401</class>
<number>1406401-01</number>
<duty>团支书</duty>
<sex>男</sex>
<hometown>
<province>湖南省</province>
<city>长沙市</city>
</hometown>
</student>
<student>
<name>李四</name>
<class>1406101</class>
<number>1406101-02</number>
<duty>学习委员</duty>
<sex>女</sex>
<hometown>
<city>北京</city>
</hometown>
</student>
<student>
<name>王五</name>
<class>1406402</class>
<number>1406402-03</number>
<sex>男</sex>
<hometown>
<province>山西省</province>
<city>大同市</city>
</hometown>
</student>
<student>
<name>孙六</name>
<class>1406401</class>
<number>1406401-04</number>
<sex>男</sex>
<hometown>
<province>湖北省</province>
<city>武汉市</city>
</hometown>
</student>
<student>
<name>赵七</name>
<class>1406102</class>
<number>1406102-05</number>
<duty>班长</duty>
<sex>男</sex>
<hometown>
<province>湖南省</province>
<city>益阳市</city>
</hometown>
</student>
</students>