You are on page 1of 9

APPROVED__________________________________________________________

EXAMINATION PAPER:

ACADEMIC SESSION 2005/2006

Campus School Department Level TITLE OF PAPER COURSE CODE Date and Time LONDON 13.30 HONG KONG 18.00 TRINIDAD 09.30 MALTA 15.00 MALAYSIA 18.00

Maritime Greenwich Computing and Mathematical Sciences Computer Science Three Web Engineering COMP 1309 Saturday 9th December 2006 BAHRAIN 15.00 UAE 16.00 SINGAPORE 18.00 ZAMBIA 14.30 GREECE 15.00

Answer any FOUR of the following SIX questions. Each question is worth 25 marks. If you answer more than four questions, marks will ONLY be awarded for your FOUR best answers.

Web Engineering Page 1 of 9

COMP1309

View Web Engineering Exam Questions and Answers Guide

APPROVED__________________________________________________________ 1. (a) What are the advantages of using XHTML 1.1 to create new web sites as opposed to using HTML 4.01? [12 marks]

(b)

Discuss the intention, content and implementation of the WCAG. [13 marks]

2.

(a)

In the context of the World Wide Web, describe using clearly labelled diagrams what is meant by 3-tier and n-tier systems. Your answer should include a detailed example of an n-tier web service based application. [11 marks]

(b)

PHP and Microsoft ASP (Active Server Pages) operate in a markedly similar fashion, mixing executable script with HTML markup. Microsoft has now frozen the development of ASP technology and encourages web developers to migrate to their new ASP.NET technology. Even though ASP.NET takes its name from Microsoft's old web development technology, the two technologies differ widely. Discuss the difference between ASP and ASP.NET. Include in your discussion the advantages claimed for ASP.NET and any possible disadvantages. [14 marks]

Web Engineering Page 2 of 9

COMP1309

APPROVED__________________________________________________________ 3. Study the code of the DHTML web page given below. Line numbers have been added that you may refer to in your answer. (a) A web page contains an anchor tag with the following markup;
<a href="http://wat.bzort.net/search.html">Search Form at bzort.net</a>

Assuming that the web user agent is compatible with JavaScript 1.5 and CSS level 2 and the URL successfully loads, describe in detail the sequence of events in the browser following a user click event on this anchor. You should include in your answer all interactions between the web client and the web server. Your answer should not include any further user interactions. [8 marks]

(b)

Using a clearly labelled figure, describe what you expect to see in the browser when the page has loaded. [8 marks]

(c)

This page demonstrates several interesting behaviours as the user interacts with the page. Describe how these behaviours are implemented. [9 marks]

Question 3 continues on the following page

Web Engineering Page 3 of 9

COMP1309

APPROVED__________________________________________________________ Question 3 continued: search.html


1 2 3 4 5 6 7 8 9 10 11 12 13 <html> <head> <title>Search Form</title> <link href="search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search.js"></script> </head> <body onload="document.getElementById('txtTerm').focus()"> <form method="get" action="phonebook.php"> <div id="search"> <label for="txtTerm" id="txtLabel">Search Form</label><br /> <input type="submit" class="button" value="Staff" name="btnStaff" onclick="return validate(this.form,'Staff')"/> &nbsp; <input type="submit" class="button" value="Site" name="btnSite" onclick="return validate(this.form,'Site')"/> &nbsp; <input type="text" id="txtTerm" name="name" size="16" value="Search Term" onkeypress="wipe(this)" onclick="wipe(this)"/> &nbsp; <input type="submit" class="button" value="Google" name="btnGoogle" onclick="return validate(this.form,'Google')"/> &nbsp; <input type="submit" class="button" value="Ask" name="btnAsk" onclick="return validate(this.form,'Ask')"/> </div> </form> </body></html>

14

15 16 17 18

search.css
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 body { font-family:verdana,sans-serif; } #search { border: solid 4px #0000AA; padding:1em; text-align:center; width:28em; margin:20px auto 20px auto; } .button { background:#EEDDFF; border: solid 2px blue; padding:0.5ex; margin-top:1em; } .button:hover { background:#FFFFAA; } #txtTerm { background:#EEEEFF; border: solid 2px blue; padding:0.5ex; }

Question 3 continues on the following page

Web Engineering Page 4 of 9

COMP1309

APPROVED__________________________________________________________ Question 3 continued: search.js


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 function validate(form,button) { var label = document.getElementById('txtLabel'); var term = form.name.value; if ( (term == "Search Term") || (term == "") ) { label.innerHTML = "Please enter a search term"; form.name.focus(); return false; } label.innerHTML = "Search Form"; if ( button == "Staff" ) { var locn = "phonebook.php?query=" + term; } else if ( button == "Site" ) { var locn = "siteSearch.php?query=" + term; } else if ( button == "Google" ) { var locn = "http://google.co.uk/search?hl=en&q=" + term; } else if ( button == "Ask" ) { var locn = "http://uk.ask.com/web?q=" + term; } window.location = locn; return false; } function wipe(textBox) { if ( textBox.value == "Search Term" ) { textBox.value = ""; } }

Web Engineering Page 5 of 9

COMP1309

APPROVED__________________________________________________________ 4. (a) The principal protocol of the World Wide Web, HTTP is often described as being a stateless protocol. (i) (ii) (iii) (iv) What is HTTP? What is meant by the expression stateless protocol? What are the advantages of a stateless protocol for the WWW? What is meant by the expression stateful web application? [12 marks]

(b)

Compare and contrast the GET and POST methods of HTTP. [13 marks]

5.

What is the DOM and how is it used with HTML and XML? You should provide some small examples and code snippets in your answer. [25 marks]

Web Engineering Page 6 of 9

COMP1309

APPROVED__________________________________________________________ 6. An XML language ExaML has been developed to create exam papers. An example ExaML file, q6.xml, is given below. (a) The first line of a document type definition (DTD) for ExaML is given below.
<!ELEMENT exam (question+)>

(i) (ii) (iv)

What is a DTD? What is a DTD used for? How does a DTD compare with alternatives? [6 marks]

(b)

Complete the DTD given in part (a) based on q6.xml found on the next page. [9 marks]

(c)

Describe in detail, with the aid of a figure, what you would expect to see when q6.xml is viewed in a browser that can process XSLT. (Character references 60, 62 and160 are less than, greater than and non-breaking space respectively) [10 marks]

Question 6 continues on the following page

Web Engineering Page 7 of 9

COMP1309

APPROVED__________________________________________________________ Question 6 continued: q6.xml


<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="q6.xsl"?> <exam> <question mark=""> An XML language ExaML has been developed to create exam papers. An example ExaML file, q6.xml, is given below. <section mark="6"> The first line of a document type definition (DTD) for ExaML is given below. <code> &#60;!ELEMENT exam (question+)&#62; </code> <subsection mark=""> What is a DTD? </subsection> <subsection mark=""> What is a DTD used for? </subsection> <subsection mark=""> How does a DTD compare with alternatives? </subsection> </section> <section mark="10"> Complete the DTD given in part (a) based on q6.xml </section> <section mark="9"> Describe in detail, with the aid of a figure, what you would expect to see when q6.xml is viewed in a browser that can process XSLT. (Character references 60, 62 and160 are less than, greater than and non-breaking space respectively) </section> </question> </exam>

exam.xsl
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <head> <title>Exam</title> <style type="text/css"> body { padding:20px; } ol.Q { list-style-type:decimal; } ol.S { list-style-type:lower-alpha; } ol.SS { list-style-type:lower-roman; } .tty { font-family:monospace } .mark { text-align:right; } </style>

Question 6 continues on the following page

Web Engineering Page 8 of 9

COMP1309

APPROVED__________________________________________________________ Question 6 continued:


</head> <body> <h1>Exam</h1> <ol class="Q"> <xsl:apply-templates select="//question"/> </ol> </body> </html> </xsl:template> <xsl:template match="question"> <li> <xsl:value-of select="text()"/> <div >&#160;</div> <ol class="S"><xsl:apply-templates select="section"/></ol> <xsl:apply-templates select="@mark"/> </li> </xsl:template> <xsl:template match="section"> <li> <xsl:value-of select="text()"/> <p class="tty"><xsl:value-of select="code"/></p> <ol class="SS"><xsl:apply-templates select="subsection"/></ol> <xsl:apply-templates select="@mark"/> </li> </xsl:template> <xsl:template match="subsection"> <li> <xsl:value-of select="text()"/> <xsl:apply-templates select="@mark"/> </li> </xsl:template> <xsl:template match="@mark"> <div class="mark"> <xsl:choose> <xsl:when test=". = ''"> &#160; </xsl:when> <xsl:otherwise> [<xsl:value-of select="."/> marks]<br />&#160; </xsl:otherwise> </xsl:choose> </div> </xsl:template> </xsl:stylesheet>

View Web Engineering Exam Questions and Answers Guide

Web Engineering Page 9 of 9

COMP1309

You might also like