You are on page 1of 7

APPROVED__________________________________________________________

EXAMINATION PAPER:

ACADEMIC SESSION 2008/2009

School

Computing and Mathematical Sciences

Department

Computer Science

Level

Three

TITLE OF PAPER

Web Engineering

COURSE CODE

COMP1309

Date

Monday 8th June 2009

Duration

2 Hours

BAHRAIN
GREECE
KENYA
MALAYSIA
MALIWI
MYANMAR
SAUDI ARABIA
SRI LANKA
SYRIA
TRINIDAD
ZAMBIA

15:00
15:00
16:00
18:30
14:00
15:30
16:00
18:30
14:00
09:30
15:00

BOTSWANA
HONG KONG
LONDON
MALTA
MAURITIUS
RWANDA
SINGAPORE
SOUTH AFRICA
TANZANIA
UAE

15:00
18:30
13:00
15:00
18:00
14:00
17:30
15:00
16:00
17:00

You MUST answer question 1 from Section A which is worth 40 marks


AND TWO questions from section B which are worth 30 marks each.
If you answer more than two questions from section B, marks will ONLY be awarded
for your TWO best answers.
CALCULATORS AND ELECTRONIC DEVICES ARE NOT PERMITTED

View Web Engineering Exam Questions and Answers Guide

APPROVED___________________________________________________________
Section A (Compulsory)
1.

(a)

Study the XHTML web page source code given below. Line numbers
have been added for convenience. If you were to validate this
code using for convenience the W3C markup validation service,
which of the following would this code validate as? Explain why.

XHTML 1.1

XHTML basic 1.1

XHTML 1.1 plus MathML 2.0

XHTML 1.1 DTD with XML 1.0 / UTF-8

None of the above


[3 marks]
01
02
03
04
05
06
07
08
09
10

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


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>Welcome to myspace</title>
</head>
<body>
<p>Welcome to another exciting yet simple webpage!</p>
</body>
</html>

(b)

Change the web page source code above so that using, the W3C markup
validation service, it validates as XHTML 1.0 Strict.
[3 marks]

(c)

Study the following web page source code. Line numbers have been
added for convenience. This code will NOT validate as XHTML 1.0
Transitional as there are errors in it. Identify three of these errors.
[3 marks]
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20

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


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Welcome to myspace</title>
<SCRIPT LANGUAGE="javascript">
function highlightButton(s)
{
if ("INPUT"==event.srcElement.tagName)
event.srcElement.className=s
}
</SCRIPT>
</head>
<body>
<p>Welcome to another exciting yet simple webpage </p>
<FORM NAME=highlight onMouseover="highlightButton('start')"
onMouseout="highlightButton('end')">
<INPUT TYPE="button" VALUE="Pass Your Mouse Over Me"
onClick="location.href='http://www.google.co.uk">
</FORM>
</body>
</html>

Question 1 continues on the next page


______________________________________________________________________
Web Engineering
COMP1309
Page 2 of 7

APPROVED___________________________________________________________
Question 1 continued
(d)

Study the following web page source code. Line numbers have been
added that you may refer to in your answer. Indicate if this code will
validate as XHTML 1.0 strict and show with the help of a diagram what
you would expect to see in your browser when this page loads.
[10 marks]
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
<head>
<title> Appointments page </title>
</head>
<body>
<p>
Please Choose a Day:
<br /><br />
<select name="day">
<option selected="selected">Monday</option>
<option>Tuesday</option>
<option>Wednesday</option>
<option>Thursday</option>
<option>Friday</option>
</select>
</p>
<p>
Please Choose a time:
<br /><br />
<select name="time">
<option selected="selected">09:00-10:00</option>
<option>10:00-11:00</option>
<option>11:00-12:00</option>
<option>12:00-13:00</option>
<option>13:00-14:00</option>
<option>14:00-15:00</option>
<option>15:00-16:00</option>
<option>16:00-17:00</option>
</select>
</p><p>----------------------------------------------------</p>
</body>
</html>

(e)

Identify five of the most important requirements to make your pages


XHTML compliant.
[7 marks]

(f)

Study the following XML web page source code (consisting of


schedule.xml and schedule.xslt). Line numbers have been added for
convenience. Show with the help of a diagram what you would expect to
see in your browser when this page loads.
[14 marks]
Schedule.xml
01
<?xml version="1.0" encoding="UTF-8"?>
02
<?xml-stylesheet type="text/xsl" href="schedule.xslt"?>
03
<schedule>
04
<owner>
05
<name>
06
<first>Eric</first>
07
<last>Burke</last>
08
</name>
09
</owner>

Question 1 continues on the next page


______________________________________________________________________
Web Engineering
COMP1309
Page 3 of 7

APPROVED___________________________________________________________
Question 1 continued
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

<appointment>
<when>
<date month="03" day="15" year="2001"/>
<startTime hour="09" minute="30"/>
<endTime hour="10" minute="30"/>
</when>
<subject>Interview potential new hire</subject>
<location>Rm 103</location>
<note>Ask Bob for an updated resume.</note>
</appointment>
<appointment>
<when>
<date month="03" day="15" year="2001"/>
<startTime hour="15" minute="30"/>
<endTime hour="16" minute="30"/>
</when>
<subject>Dr. Appointment</subject>
<location>1532 Main Street</location>
</appointment>
<appointment>
<when>
<date month="03" day="16" year="2001"/>
<startTime hour="11" minute="30"/>
<endTime hour="12" minute="30"/>
</when>
<subject>Lunch w/Boss</subject>
<location>Pizza Place on First Capitol Drive</location>
</appointment>
</schedule>

Schedule.xslt
01
<?xml version="1.0" encoding="UTF-8"?>
02
<xsl:stylesheet
03
version="1.0"
04
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
05
<xsl:output method="xml"
06
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
doctypesystem="http://www.w3.org/TR/xhtml1/DTD/xhtml1transitional.dtd"/>
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

<!--****************************************************************
** "/" template
*************************************************************-->
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Schedule</title>
</head>
<body>
<h2 align="center">
<xsl:value-of select="schedule/owner/name/first"/>
<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>
<xsl:value-of select="schedule/owner/name/last"/>'s
Schedule</h2>
<xsl:apply-templates select="schedule/appointment"/>
</body>
</html>
</xsl:template>
<!--***************************************************************
** "appointment" template
************************************************************-->
<xsl:template match="appointment">
<hr/>
<h3>Appointment</h3>
<xsl:apply-templates select="when"/>

Question 1 continues on the next page


______________________________________________________________________
Web Engineering
COMP1309
Page 4 of 7

APPROVED___________________________________________________________
Question 1 continued
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

<table>
<tr>
<td>Subject:</td>
<td>
<xsl:value-of select="subject"/>
</td>
</tr>
<tr>
<td>Location:</td>
<td>
<xsl:value-of select="location"/>
</td>
</tr>
<tr>
<td>Note:</td>
<td>
<xsl:value-of select="note"/>
</td>
</tr>
</table>
</xsl:template>
<!--****************************************************************
** "when" template
*************************************************************-->
<xsl:template match="when">
<p>
<xsl:value-of select="date/@month"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="date/@day"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="date/@year"/>
from
<xsl:value-of select="startTime/@hour"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="startTime/@minute"/>
until
<xsl:value-of select="endTime/@hour"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="endTime/@minute"/>
</p>
</xsl:template>
</xsl:stylesheet>

______________________________________________________________________
Web Engineering
COMP1309
Page 5 of 7

APPROVED___________________________________________________________
Section B (Answer any TWO questions)
2.

(a)

Give three advantages of XML over HTML.


[9 marks]

(b)

01
02

The author of the following source code claims that the included
Javascript works and enhances this web page. Your task is to identify if
the script will run without any errors. Show with the help of a detailed
diagram what you would expect to see in your browser when this page
loads. Line numbers have been added that you may refer to in your
answer.
[21 marks]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

03
04

<head>
<title> Some Javascript </title>

05

<script language="JavaScript">

06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

<!-- Begin
function setit() {
var a = "Hope you like this";
var b = "one bit of XHTML and Javascript";
var c = "a bit of creativity";
var t = new Date();
s = t.getSeconds();
if (s == 10) {
document.title = a;}
else if (s == 20) {
document.title = b;}
else if (s == 30) {
document.title = c;}
else if (s == 40) {
document.title = a;}
else if (s == 50) {
document.title = b;}
else if (s == 00) {
document.title = c;}
setTimeout("setit()", 500);
}
// End -->
</script>

29
30
31
32
33
34
35

</head>
<body onLoad="setit()">
<p><center>
<font face="arial, helvetica" size"-2">A Javascript example<br></font>
</center><p>
<p>This page is to help as a mini guide<br>-do not click away<br><br>it will be
updated on a daily basis
<p>

36
37

</body>
</html>

______________________________________________________________________
Web Engineering
COMP1309
Page 6 of 7

APPROVED___________________________________________________________
3.

An article published recently describes how The UK government plans to issue


new, less technical guidelines on how to make public-sector websites accessible
to disabled people. The article continues to report that A study of websites
run by the 25 member states of the European Union (EU) found that 97% failed
to pass the most basic, internationally agreed standard of website accessibility.
Assume that you are working for a web development agency and you have been
asked to develop an e-voting website. Discuss the website accessibility factors
and issues involved in the development of a public service e-voting website.
[30 marks]

4.

(a)

Evaluate critically, the contributions and importance of open source


technologies for building web applications.
[15 marks]

(b)

The term LAMP is being used more and more in the commercial IT
environment. LAMP refers to a solution stack comprising of the
following technologies:
Linux, the operating system;
Apache, the web server;
MySQL, the database server;
PHP, the web scripting language.
Explain why LAMP is becoming increasingly popular as a solution
stack for building web applications.
[15 marks]

View Web Engineering Exam Questions and Answers Guide

______________________________________________________________________
Web Engineering
COMP1309
Page 7 of 7