Assignment 2 Term 2, 2014
Introduction
This is an individual assignment, in which you can explore the use of extensible files in web programming, using PHP and XML.
Details of the weight of the assignment and due date are given in the course description.
Task Description
Introduction
A simple database with a single table contains data concerning domestic airline bookings in Australia. The table contains six fields that store data relating to a unique booking reference, customer name, flight id, departure date, seat booked and fare e.g. BM308Z, John Citizen, QF237, 231014, 24D, $127.95. There are constraints placed on the data that are described below.
The assignment tasks are closely associated with the lab work of topics 8 to 10. Code which is provided in the topic 10 lab work should be a useful guide throughout this assignment.
The assignment requires a number of files and a report to be produced. The report should respond to written tasks that are included below.
Initial task
In a word document, create a table of about 6 records with no NULLs. Add the table to your report, showing clearly the names of the table and the fields.
Tasks supported by Topics 7 and 8
Mark up the table of data using XML tags and save it as an .xml file. Check that the file is well-formed and report the method used for this check. Make a deliberate error in either an opening tag or a closing tag (but not both) and report the error message.
Create a corresponding XMLSchema file (.xsd) that contains the following constraints:
• The customer name is a string with a maximum of 36 characters;
• The booking reference, flight id and seat are alphanumeric strings each with its own format: booking reference (XX999X), flight id (XX999) and seat (99X) where X is alpha and 9 is numeric;
• Dates are in ‘yymmdd’ format;
• Fares are decimals with two digits after the decimal point; no fare exceeds $1000.
Use the .xsd file to validate your .xml file. Test the validation of the .xml file by breaking each constraint in turn and report the results. Also deliberately invalidate the .xml file (but keeping it well-formed) and report the response.
Task supported by Topic 9
Create an XSLT stylesheet file (.xsl) that supports the display of the data in a table. The data is to be displayed either in descending fare order or in ascending departure date order as requested by the user.
Task supported by Topic 10
Create new DOM documents for each of your .xml and .xsl files. Use these to generate output to the browser.
Comment on the result.
Research
Access the XML DOM Tutorial at http://www.w3schools.com/dom/dom_nodes_set.asp. Under the ‘Manipulate
Nodes’ heading study the ‘Get Values’ and ‘Change Nodes’ sections. It will be important to have an understanding of the Dom Node Tree from Topic 10 prior to this study. Write your own code to show that you can both retrieve the value of the seat of the first record in your XML file and change its value.
Report contents
1. Diagram of the table containing the initial data.
2. State how you checked that the XML file is well-formed.
3. What messages are sent if it is not well-formed?
4. State how you checked that the XML file is valid.
5. What messages are sent if the XML file is well-formed but not valid?
6. What messages are sent if constraints are not met by the data?
7. The .xsd file is also written in XML so that can also be validated. How is this done?
8. Comment on the output provided by your two DOM documents.
9. Draw a diagram showing the structure of the DOM tree associated with the .xml file, using data from any ONE record.
10. Give details of any assistance received (apart from teaching staff).
Additional task for ITECH6224 students
On the topic of “What, why and how of web usability†identify four (4), relevant, independent resources. Use these resources to discuss the topic in about 500 words. Take care to cite appropriately.
Further details
Refer to the Course Description for details of submission to Moodle, late assignments, extensions, special consideration, plagiarism, student support, presentation of academic work and adopted reference style.
Submission
All files should be zipped and uploaded to Moodle by the due date and time.
GET ANSWERS / LIVE CHAT