Starting from:

$25

CSCI128 - Lab 6 - Solved

Question 1. This is the content of an XML file q1-error.xml​  

 

<?xml version="1.0" encoding="UTF-8"?> 

 <student sn=3719301> 

   <firstName>John</firstName> 

   <lastName>Smith</lastName> 

   <email>jsmith@gmail.com</email> 

 </student> 

 

 <student sn=6382520> 

   <firstName>Mary</firstName> 

   <lastName>Jane</lastName> 

   <email>mjane@gmail.com</email> 

 </student> 
 

The above XML file contains several errors. 

Your task is to identify these errors and correct them. 

Save your correct XML code into a new file called q1-correct.xml. 

 

Question 2. Have a look at the following XML sample code. Your task is to create an XML file called q2.xml and write XML code to include 5 staff records. 

<?xml version="1.0" ?> 

<dailyUpdate campus="Woolloomooloo" date="24/02/2016"> 

 <staff operation="update"> 

   <staffNumber>0154728</staffNumber> 

   <firstName>John</firstName> 

   <lastName>Smith</lastName> 

 </staff> 

 

 <staff operation="add"> 

   <staffNumber>5287523</staffNumber> 

   <firstName>Mary</firstName> 

   <lastName>Jane</lastName> 

 </staff> 

</dailyUpdate> 
Page 1 of 2 

 

Question 3. Write an XML document called q3.xml that represents the following student record:​    

 

  

 

 

Question 4. Copy the code from q3.xml to q4.xml.​    In q4.xml, write the corresponding internal DTD. 

 

 


More products