Advanced Web Technologies

Blog posts as part of the BSc Internet Application Development programme to discuss my experience while working on the tasks that will be given during the Advanced Web Technologies module.

  1. Write an XML document that contains the following information: your name. Your email address. Your student number. Your home town. Your date of birth. Choose appropriate tags. Use Attributes for the date of birth.

    The .dtd file will be as follows:
    1:   <!DOCTYPE students [  
    2:   <!ELEMENT students (student*)  
    3:   <!ELEMENT student (firstName, lastName, email, homeTown)>  
    4:   <!ELEMENT firstName (#PCDATA)>  
    5:   <!ELEMENT lastName (#PCDATA)>  
    6:   <!ELEMENT email (#PCDATA)>  
    7:   <!ELEMENT homeTown (#PCDATA)>
    8:   <!ATTLIST student studentNo ID #REQUIRED>
    9:   <!ATTLIST dob CDATA #REQUIRED> 
    10:  ]>  
    
    The XML file will be:
    1:   <?xml version="1.0" ?>  
    2:   <!DOCTYPE students SYSTEM "students.dtd">  
    3:   <students>  
    4:      <student studentNo="M00362929" dob="1989-04-30">  
    5:         <firstName>Stephanie</firstName>  
    6:         <lastName>Vella</lastName>  
    7:         <email>vella.steve@gmail.com</email>  
    8:         <homeTown>San Gwann</homeTown>  
    9:      </student>  
    10:  </students>  
    
  2. Have a look at the XML document found in the question sheet below. Identify all the syntax errors.

    • The root element in the DTD declaration is "countryCollection", while in the XML document is "CountryList";
    • There is no end tag for "CountryList";
    • There should not be a -- between CIA and Year Book <!--Data from CIA --Year Book -->
    • XML tags are case sensitive, therefore <Label> is different from <label>. This applies to all the document;
    • A tag should not be started with a number such as <2ndCity>;
    • It is not well formed <Label>Capital:</capital> <Capital cityNum="1">Washington, D.C. </label>. It should be <Label>Capital:</Label> <Capital cityNum="1">Washington, D.C. </Capital>;
    • The line <MajorCity cityNum="5'> should be <MajorCity cityNum="5">;
    • The attribute cityNum="1" should be inside the opened tag not the close tag <Capital>Tokyo</capital cityNum="1">;
    • You can't have the same attributes in one tag such as <MajorCity cityNum='6' cityNum='7'>;
    • Comments cannot be written inside a tag such as <BorderingBodyOfWater <!--Also Lake Victoria --> >.

Question Sheet:

Question Sheet: Lab 3