DTD:文档类型定义 DTD 的作用是定义 XML 文档的结构
记事本,后缀:.dtd
<?xml version = "1.0" encoding="gb2312"?>
<!ELEMENT book (details+)>//ELEMENT大写 +:表示可包含
一个以上(xml中)
<!ELEMENT details ( name, author+, publication,
price)>+:表示可包含一个以上
<!ELEMENT name (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT publication (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ENTITY country "中国">
<!ENTITY count "印度">
<!ENTITY rights "版权所有">
<!ENTITY pricenotation "$">
记事本 后缀.xml
<?xml version = "1.0" encoding="gb2312"?>
<!DOCTYPE book SYSTEM "Example3.dtd">//引用dtd格式
<book>
<details>
<name>xml 使用详解&country;</name>
<author>成龙来自</author>
<author>成龙来自</author>
<publication>Mac &rights;</publication>
<price>&pricenotation;50</price>
</details>
<details>
<name>xml 揭密</name>
<author>Raghu 来自&count;</author>
<publication>Mac &rights;</publication>
<price>&pricenotation;45</price>
</details>
</book>