Professional Documents
Culture Documents
EXAMINATION PAPER:
School
Department
Computer Science
Level
Three
TITLE OF PAPER
Web Engineering
COURSE CODE
COMP1309
Date
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
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
(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
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
(e)
(f)
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">&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"/>
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)
(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]
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.
4.
(a)
(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]
______________________________________________________________________
Web Engineering
COMP1309
Page 7 of 7