Tuesday, 30 March 2010

CMT3315 – Laboratory 03 – 14 October 09

Questions

1. The following XML document that contains the following information: my name, my email address, my student number, my home town, my date of birth. I have chosen appropriate tags and used attributes for the date of birth.


<?xml version="1.0"?>

<student DOB= “22/06/1987”>

     <name>Saif</name>

     <email>saif71@hotmail.com</email>

     <studentnumber>M00052834</studentnumber>

   <hometown>Barking</hometown>

</student>




2. An XML document was provided in class. From it,I have identified the following syntax errors bellow: -

&lt;?xml version= “1.0” ?&gt;

&lt;!DOCTYPE countryCollection SYSTEM "countryList.dtd"&gt;

&lt;CountryList&gt;

&lt;Nations TotalNations =”3”/&gt;

&lt;!--Data from CIA --Year Book --&gt;



<Country CountryCode=”1”>  this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.

<OfficialName>United States of America</officialName> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<Label>Common Names:</label> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<CommonName>United States</commonName> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<CommonName>U.S.</commonName> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.




<Label>Capital:</capital> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error. Also this starts of with the closing tag for “capital” before the start tag, therefore the tag is not nested properly.

<Capital cityNum=”1”>Washington, D.C. </label>

<2ndCity cityNum=”2”>New York </2ndCity>

<Label>Major Cities:</label> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.





<MajorCity cityNum=”3”>Los Angeles </majorCity> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<MajorCity cityNum=”4”>Chicago </majorCity> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<MajorCity cityNum=”5’>Dallas </majorCity> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error. The element inside has two different types of quotation marks which is also wrong.



<Label>Bordering Bodies of Water:</label> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<BorderingBodyOfWater> Atlantic Ocean </borderingBodyOfWater> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<BorderingBodyOfWater> Pacific Ocean </borderingBodyOfWater> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.




<BorderingBodyOfWater> Gulf of Mexico </borderingBodyOfWater> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<Label>Bordering Countries:</label> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<BorderingCountry CountryCode=”1”> Canada </borderingCountry> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<BorderingCountry CountryCode =”52”> Mexico </borderingCountry> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



</country>

<Country CountryCode=”81”>  this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<OfficialName> Japan </officialName> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<Label>Common Names:</label> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<CommonName> Japan </commonName> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<Label>Capital:</label> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<Capital>Tokyo</capital cityNum=”1”>  this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error. Also the attribute value is in the end tag which is incorrect as the attribute can only be placed inside the start tag.





<2ndCity cityNum=”2”>Osaka </2ndCity> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<Label>Major Cities:</label> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<MajorCity cityNum=”3”>Nagoya </majorCity> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<MajorCity cityNum=”4”>Osaka </majorCity> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<MajorCity cityNum=”5’>Kobe </majorCity> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<Label>Bordering Bodies of Water:</label> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<BorderingBodyOfWater>Sea of Japan </borderingBodyOfWater> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<BorderingBodyOfWater>Pacific Ocean </borderingBodyOfWater> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.





</country>

<Country CountryCode=”254”>  this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<OfficialName> Republic of Kenya </officialName> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<Label>Common Names:</label> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<CommonName> Kenya </commonName> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<Label>Capital:</label> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.




<Capital cityNum=’1’>Nairobi </capital> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<2ndCity cityNum=’2’>Mombasa</2ndCity> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.

<Label>Major Cities:</label> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.

<MajorCity cityNum=’3’>Mombasa </majorCity> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.

<MajorCity cityNum=’4’>Lamu </majorCity> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<MajorCity cityNum=’5’>Malindi </majorCity> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.

<MajorCity cityNum=’6’ cityNum=’7’>Kisumu-Kericho </majorCity> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.

<Label>Bordering Bodies of Water:</label> this start tag is capitalised but the end tag does not start with a capital letter, therefore it is an error.



<BorderingBodyOfWater <!--Also Lake Victoria --> > Indian Ocean </borderingBodyOfWater>

</country>



Lecture Reflection-WEEK 3 - CSS

The lecture for the commencing week was easy and basic. The content of the lecture included Cascading Style Sheets (CSS) and The Extensible Style Sheets Language (XSL).
CSS is a style sheet used to style HTML. Style sheets can be external which allows multiple WebPages access to the CSS formatting or it can be internally scripted within the website it is intended to style. CSS can also be used to style XML however has limitations to its ability.
XSL on the other hand, is the style sheet used mainly for XML and is a much more powerful tool for styling then CSS. It allows the usage of XPATH which can be used to handle document components and therefore giving it some programming power. The basic concept is to use CSS with the simple styling and XSL for the more complicated style output.

http://www.ronnysmarket.com/
http://www.ronnysmarket.com/catalog/main

No comments:

Post a Comment