本文主要是介绍XML DTD,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
classroom.dtd
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT classroom (cname,grade,student)>
<!ATTLIST classroom id ID #REQUIIRED/>
<!ELEMENT cname (#PCDATA)>
<!ELEMENT grade (#PCDATA)>
<!ELEMENT students (student+)>
<!ELEMENT student (id,name,age)>
<!ELEMENT id (#PCADA)>
<!ELEMENT name (#PCADA)>
<!ELEMENT age (#PCADA)>
classroom.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE classroom SYSTEM classroon.dtd>
<classroom id="c1">
<cname>计算机1002班</cname>
<grade>2012</grade>
<students>
<student>
<id>11</id>
<name>张三</name>
<age>21</age>
</student>
<student>
<id>12</id>
<name>李四</name>
<age>21</age>
</student>
<student>
<id>13</id>
<name>王五</name>
<age>21</age>
</student>
</students>
</classroom>
这篇关于XML DTD的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!