
110 • XML & Related Technologies
Exercise 1: Prepare an XML document and show the corresponding
DTD for representing student name.
Solution 1:
XML document (student.xml)
<?xml version=”1.0”?>
<!-- This XML document refers to studentinfo.dtd -->
<!DOCTYPE student SYSTEM “studentinfo.dtd”>
<student>
<student_name>A Kahate</student_name>
</student>
DTD le (studentinfo.dtd)
<!ELEMENT student (student_name)>
<!ELEMENT student_name (#PCDATA)>
Exercise 2: Show the above in the form of an internal DTD.
Solution 2:
<?xml version=”1.0”?>
<!DOCTYPE student [
<!ELEMENT student_name (#PCDATA)>
]>
<student>
<student_name>A Kahate</student_name>
</student>
3.3.1 Valid