Part 1: XML and DTD
Exercise 1: Which of the following Tags names are valid, which are not? Explain your
answers.
<lecture>
<student and teacher>
<student&teacher>
<DilbertComicStrip>
<XMLisFun>
<4u>
<student.and.teacher>
<>
Exercise 2: The following XML document describes some entries of a library
<library>
<book id=2003-Blanken>
<title>Intelligent XML Search</title>
<editor>Henk A. Blanken et al.</editor>
<publisher>Springer Verlag</PUBLISHER>
</book>
<journal id="TODS_1_2003 publ_year="2003">
<title>ACM Transactions on Databases</title>
<volume>24<number>1</number></volume>
</journal>
<misc id="Dipl2002-12" id="TR2002-01-04">
<author>U. Known</author>
<title>The Diploma Thesis that didn’t appear
<year>2002</year>
<pages>0</pages>
</misc>
</library>
Check if the XML document is well-formed. If it is not, change it so that it becomes well-
formed, making as little changes as possible.
Exercise 3: Write DTD for the following XML:
<address>
<name>
<first>Tran</first>
<last>Khoa</last>
</name>
<email>khoatranchemistry@gmail.com</email>
<phone>0917741703</phone>
<birthday>
<year>2000</year>
<month>November</month>
<day>16</day>
</birthday>
</address>
Part 2: XML Parser
XAMPP Download Link:
https://drive.google.com/file/d/1IjXr8ufGmSqqaf_WKUS4bUaYvgoWSbYR/view?
usp=sharing
Given this data table:
Movie Year Rating
Our Beloved Summer 2021 8.8
Skyfall 2012 7.8
Titanic 1997 7.8
Cloudy with a Chance of Meatballs 2009 6.9
Despicable Me 2010 7.6
1. Create an XML file movie.xml to store the data above.
2. Parse the XML file using PHP or Java and display:
a. Movie titles published before 2010
b. Movie titles have rating greater than 8