Assignment6-HTMLXML.docx

Management Information Systems

HTML – XML Lab

Objective:

This lab activity is designed for students to understand the basics of HTML and XML. By creating simple scripts for both language, students are expected to understand the claim that “XML is designed to describe data, while HTML is designed to display webpage”. Students are also expected to be able to edit simple HTML scripts.

Activities:

1. Create a simple HTML:

There are many software tools that can be used to create a HTML file. However, you can always use the most basic tool of “notepad” to type in and make minor changes of the scripts yourself in case the other software packages are not available. (fast!)

a. Go to “start” “programs” “accessories” “notepad”

b. Type in the first tag pair “<html> </html>”[footnoteRef:1]. [1: If you have read the book page 235-236, you will know that all the HTML file contains content + a set of predefined tags. The tags are mainly used to control the display of content. Tags always appear in pairs, and the content it controls will be included in between. Therefore it is always a good habit to write the pair first before you forget one of them.]

c. Insert content between the “html” tags as follows:

<html>

<title> HTM304 HTML Lab </title>

<body>

Using MIS

</body>

</html>

d. Save your file, name it “lab.html”.

e. Find the file “lab.html” from Internet explorer and open it in Internet Explorer. Observe where the title is shown, and where the main body is shown.

f. Add more content below “Using MIS”, observe the change.

Example HTML Document

Click here for textbook website at Prentice-Hall: Web Site Link

g. Add more tags to control the display.

i. Add control tag <h1 align= “center”> in front of “Using MIS”, don’t forget to add the close control </h1> after “Using MIS”.

ii. Add control tag <h2> and </h2> for the second sentence

iii. Add hyperlink to the “Web Site Link”:

<a href= “http://www.prenhall.com/kroenke”> Web Site Link </a>

h. View the result now. Add some other changes as you want.

i. Print the screen and paste the picture displaying your webpage to a word file.

2. Create a simple XML:

Here is a simple script for XML. Try to think the similarity and difference compare to HTML.

<note>

  <to>Tove</to>

  <from>Jani</from>

  <heading>Reminder</heading>

  <content>Don't forget me this weekend!</content>

</note>

Below is some explanation of XML. Try to understand it and think of the benefits of such design.

What is XML?

· XML stands for EXtensible Markup Language

· XML is a markup language much like HTML

· XML was designed to describe data

· XML tags are not predefined. You must define your own tags

· XML uses a Document Type Definition (DTD) or an XML Schema to describe the data

· XML with a DTD or XML Schema is designed to be self-descriptive

· XML is a W3C Recommendation

Now let’s translate to Database:

1. Copy the following code and save it in a file and name it “breakfast.xml”.

2. Open Microsoft Access and create a new database named “XMLLab.accdb”.

3. Go to “External Data” Tab and choose XML File, select the file “breakfast.xml” from the right directory. Observe the final table.

4. Copy the resulting table to the same word file you created in the first lab. Save and upload the file to the Moodle site for credit.

<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- Edited by XMLSpy® -->

<breakfast_menu>

<food>

<name>Belgian Waffles</name>

<price>$5.95</price>

<description>two of our famous Belgian Waffles with plenty of real maple syrup</description>

<calories>650</calories>

</food>

<food>

<name>Strawberry Belgian Waffles</name>

<price>$7.95</price>

<description>light Belgian waffles covered with strawberries and whipped cream</description>

<calories>900</calories>

</food>

<food>

<name>Berry-Berry Belgian Waffles</name>

<price>$8.95</price>

<description>light Belgian waffles covered with an assortment of fresh berries and whipped cream</description>

<calories>900</calories>

</food>

<food>

<name>French Toast</name>

<price>$4.50</price>

<description>thick slices made from our homemade sourdough bread</description>

<calories>600</calories>

</food>

<food>

<name>Homestyle Breakfast</name>

<price>$6.95</price>

<description>two eggs, bacon or sausage, toast, and our ever-popular hash browns</description>

<calories>950</calories>

</food>

</breakfast_menu>

2