Aug 25, 2006, 8:41 AM
Post #1 of 5
Can anybody help me in solving these questions. I need solutions. PLZ Question 1
Can anybody help me in solving these questions? PLZ
Consider the following games.xml document.
<?xml version = "1.0"?>
<!-- games.xml -->
<!-- Sports Database -->
<game id = "783">
Popular in Commonwealth nations.
<game id = "239">
Popular in America.
<game id = "418">
Popular sport in the world.
i. Write a suitable Document Type Definition file, games.dtd, against which games.xml can be validated. [5 pts]
ii. What is the correct XML Processing Instruction for the inclusion of games.dtd in games.xml? [5 pts]
iii. Write suitable XSL code for transforming games.xml into games.html. games.html must be an HTML file that displays the contents of games.xml in the form of a table as shown below. The XSL code must be stored in games.xsl file.
iv. What is the correct XML Processing Instruction for the inclusion of games.xsl in games.xml? [5 pts]
a) Good websites will always have a visible hit/visitor counter that saves as testament as to how popular the site is. Write a simple Perl script that implements a hit/visitor counter, visi-count.pl. This script must display the count in the form of a single-row, multi-column table with each cell containing a single digit of the count. Each cell must have a different-coloured digit, e.g. [20 pts]
b) Give the correct Server-Side-Include (SSI) command for the inclusion of visi-count.pl on an HTML web page. [5 pts]
Write a Perl program county.pl that creates a named scalar variable called $counties with a value of “Dublin, Kerry, Killkenny, Offaly, Cork, Waterford, Wexford, Laoise, Clare”. Using all the Perl techniques that you have learnt, your program must also do the following.
i. Search for a county in $counties that ends in in and store it as the first element in array @gaa_winners
ii. Search for a county whose name begins with C and ends with K and store this as the next element in array @gaa_winners
iii. Find all counties with names beginning with K or ending in Y and add them to the array @gaa_winners.
iv. The contents of array @gaa_winners must be written into an XML file, county.xml with the following structure. All county names must be in lower case!!!
</counties> [25 pts]
a) Draw a diagram that shows the Client/Server set-up for a MySQL database, Apache web server, Perl/CGI script and a compatible web browser. Explain briefly how each of these components behaves in this environment. How does one connect to a MySQL database using Perl? Give a small example. [5 pts]b) GCMS maintains a member register in a MySQL Database called REGISTER. The following details are maintained in a relation called members.i. First nameii. Last nameiii. Emailiv. Phone, of the form +(dd)-(dd)-ddd dddd, where d is a digitv. Usernamevi. Password Assume the following SQL statements were used to create the members relation.DROP TABLE IF EXISTS `members`;CREATE TABLE `members` ( `firstname` varchar(15) NOT NULL default '', `lastname` varchar(15) NOT NULL default '', `email` varchar(30) NOT NULL default '', `phone` varchar(14) NOT NULL default '', `username` varchar(15) NOT NULL default '', `password` varchar(10) NOT NULL default '') ENGINE=InnoDB DEFAULT CHARSET=latin1; 1. Write HTML code for a registration form to collect a new member’s details and save them in the register database. [5 pts]2. Write a Perl/CGI script to process the data. The CGI script must generate an HTML page acknowledging the registration [15 pts] Question 5a) For the register database in question 4 (b), 1. Write an HTML page that accepts a member’s login details, i.e. username and password [5 pts]2. Write a Perl/CGI script that processes the login data and generates appropriate HTML messages if username and password are validif username and password are invalid [15 pts]
b) Compare and contrast the use of the bgsound and embed tags for the inclusion of sound on a web page. [5 pts]