第三次作业
三、请用XML语言编写描述下面的学生成绩单的XML文档并给出其DTD。本题需要提交电子版,包括文档代码,及相关说明。
平均成绩应该在xsl里面计算,这里只让写xml和dtd所以不用写
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE scoresheet SYSTEM "score.dtd">
<scoresheet>
<student>
<name>张三</name>
<course>
<title>编译方法</title>
<score>79</score>
</course>
<course>
<title>C程序设计</title>
<score>85</score>
</course>
<course>
<title>数据结构</title>
<score>93</score>
</course>
</student>
<student>
<name>李四</name>
<course>
<title>计算复杂性</title>
<score>72</score>
</course>
<course>
<title>偏微分方程</title>
<score>86</score>
</course>
<course>
<title>计算方法</title>
<score>95</score>
</course>
</student>
<student>
<name>王五</name>
<course>
<title>分子轨道理论</title>
<score>79</score>
</course>
<course>
<title>有机化学</title>
<score>80</score>
</course>
<course>
<title>分子生物学</title>
<score>88</score>
</course>
<course>
<title>无机化学</title>
<score>98</score>
</course>
</student>
</scoresheet>
<?xml version = "1.0" encoding="GB2312"?>
<!ELEMENT scoresheet (student*)>
<!ELEMENT student (name, course*)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT course (title, score)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT score (#PCDATA)>
四、为班级通讯录编写DTD、XML文档,其中包含 5 名假想的联系人及相关信息。本题需要提交电子版,包括文档代码,及相关说明。
<?xml version="1.0" encoding="GB2312"?>
<!DOCTYPE contacts SYSTEM "contacts.dtd">
<contacts>
<contact>
<name>Ami</name>
<address>UK</address>
<phone>1234</phone>
</contact>
<contact>
<name>Bob</name>
<address>USA</address>
<phone>2345</phone>
</contact>
<contact>
<name>Clare</name>
<address>Japan</address>
<phone>3456</phone>
</contact>
<contact>
<name>David</name>
<address>China</address>
<phone>4567</phone>
</contact>
<contact>
<name>Elbert</name>
<address>Italy</address>
<phone>5678</phone>
</contact>
</contacts>
<?xml version="1.0" encoding="GB2312"?>
<!ELEMENT contacts (contact*)>
<!ELEMENT contact (name, address, phone)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT address (#PCDATA)>
<!ELEMENT phone (#PCDATA)>