Click to See Complete Forum and Search --> : xml Help


7alewi
03-18-2010, 02:49 PM
Hello,

Its my first year at uni and my exams are coming up soon. My teacher gave us a list of questions (like a mock exam) to study over the holiday which will prepare us for the exam. I am stuck with this question. Any help is appreciated. I just need to know some ideas of how to do it. (not asking you to do it for me because there is no point, I want to understand how! lol).

The question is: Construct a sample XML document which is valid according to the external DTD given below. This describes information an Estate Agent might wish to store about a house. Your document should be su±ciently complex to test your implementation of the DTD (e.g., it should contain information on at least two houses).



<!ELEMENT houses (house*)>
<!ELEMENT house (room+)>
<!ELEMENT room (dimensions, windows, furniture*)>
<!ELEMENT dimensions (width, length)>
<!ELEMENT windows (window*)>
<!ELEMENT window (elevation, width, height)>
<!ELEMENT furniture (#PCDATA)>
<!ELEMENT width (#PCDATA)>
<!ELEMENT length (#PCDATA)>
<!ELEMENT height (#PCDATA)>
<!ELEMENT elevation EMPTY>
<!ATTLIST room name ID #REQUIRED
colour IDREF #IMPLIED>
<!ATTLIST elevation facing (north | south | east | west) #REQUIRED>


Your XML document start with:

<?xml version="1.0"?>
<!DOCTYPE employees SYSTEM
"http://www.cs.bham.ac.uk/~ajb/infoweb/labs/ex11.dtd">


Thanks a lot.