| DPIT128: Introduction to Web Technology Autumn Session 2020 |
Assignment 3 (10%) due by Friday 24th of April 2020 at 11:59 PM
Learning Outcomes
- Ability to develop well-formed and valid XML documents
- Experience defining XML validation schemas using contemporary approaches (namely DTD and XSD)
- Ability to use XSLT to display XML data in a more natural and meaningful format
- Ability to validate XML documents against internal and external schemas using online validation services
Submission Instructions
You will need to submit a total of 5 files using the “Assignment 3” submission facility on Moodle. Please see the table below for an overview of the files (including their names and extensions) that are required for each task.
| Task | Files Required | |
| 1 | A3_TASK1.xml |
|
| 2 | A3_TASK2.xml | |
| 3 | A3_TASK3.xsd | |
| 4 | A3_TASK4.xml | A3_TASK4.xsl |
The assessor will be using the Google Chrome browser. Please test your work with this browser prior to submission.
This assignment is scheduled to be marked in the laboratory during Weeks 8 & 9. Marks will be deducted if you cannot answer the questions asked about your solution by the assessor.
Please be aware of the following:
- Late submissions will incur an awarded mark deduction of 10% for each day late.
- Submissions more than 3 days late will not be marked (a zero will be automatically awarded).
- If you need an extension, please apply for academic consideration before the assignment due date/time. The UOW College Academic Consideration Policy can be found at the following URL:
- Plagiarism is treated seriously. If we suspect that work has been copied, ALL students involved are likely to be awarded a mark of zero for the assignment.
There are 4 tasks in this assignment.
Task 1: Download and extend the A3.xml file available on Moodle (also available here) to include all the information provided in the following table. The first hotel has already been inserted to demonstrate the structure that should be used for each record.
| Hotel Name | Stars | Reviews | Score |
| Novotel Wollongong Northbeach | 4.5 | 4677 | 8.2 |
| Sage Hotel Wollongong | 4 | 4541 | 8.4 |
| Adina Apartment Hotel Wollongong | 4.5 | 2784 | 8.9 |
| Quality Suites Pioneer Sands | 4 | 1768 | 9.1 |
| Mantra Wollongong | 4.5 | 1640 | 7.7 |
| The Belmore All Suite Hotel | 3.5 | 1015 | 8.5 |
Information obtained from Hotels Combined on the 7th of March 2020.
Please Note:
- Save your completed file as “A3_TASK1.xml”.
- This will be the first of 5 separate files that you must submit for this assignment.
- Check that your XML is well-formed by using the validation service available at the following URL:
This task is worth 1 mark.
Task 2: Create a copy of your XML file from the previous task and rename that copy to “A3_TASK2.xml”. You are now required to add an internal DTD to your “A3_TASK2.xml” file. This DTD should define the legal building blocks for your XML code structure.
Please Note:
- You must define all relevant elements and attributes within your DTD.
- You should consider all attributes as ‘required’.
- Save your completed file as “A3_TASK2.xml”.
- This will be the second of 5 separate files that you must submit for this assignment.
- Check that your XML file is valid by using the validation service available at the following URL:
This task is worth 2 marks.
Task 3: Create an XML Schema Definition file named “A3_TASK3.xsd”. Use this file to define the legal building blocks for your XML code via XSD. Keep in mind that this XML-based alternative to DTD is rapidly becoming the preferred method for describing XML structures.
Please Note:
- You must define all relevant elements and attributes within your XSD.
- You should consider all attributes as ‘required’.
- Carefully consider the data type that best applies to each value.
- Save your completed file as “A3_TASK3.xsd”.
- This will be the third of 5 separate files that you must submit for this assignment.
- Check that your XSD validates the “A3_TASK1.xml” file by using the validation service available at the following URL: https://xmlvalidation.com/
This task is worth 2 marks.
Task 4: Create a copy of your XML file from Task 1 and rename that copy to “A3_TASK4.xml”. You are now required to complete an XSLT file to link with “A3_TASK4.xml” and display its content in the following format. You must use the same layout and inclusions as shown below.
Design Requirements:
- The heading text should be displayed within a h2 element.
- The sub-heading text must be displayed within a caption element.
- The caption should have a font size of 20px and a bottom padding value of 10px specified inline.
- A border that matches the above illustration must be included (see “Design Resources”).
- The table should utilise th and td elements where appropriate.
- The background colour for all th elements must be specified internally (see “Design Resources”).
- All th and td elements should have a padding value of 10px and a font size of 20px.
- An :nth-child() pseudo-class must be applied to shade even table rows (see “Design Resources”).
- A matching alignment for all numerical columns should be specified internally using a ‘class’ selector.
- All “Total Reviews” values must use a comma as a thousand and million separator.
- Each “Overall Score” background colour should be specified internally using a ‘class’ selector.
- The text shown beneath the table must be displayed within a h3 element.
- The “Hotels Combined” hyperlink should display its destination in a new window/tab.
- The date must be presented in an Australian format (specifically as DD/MM/YYYY).
- An XSL for-each element should be used to iterate through the list of hotels.
- An XSL choose element must be used to decide which “Overall Score” background colour to apply.
- The test attribute conditions and hexadecimal colour values are provided in the table below.
| Score < 8 | 8 ≤ Score ≤ 9 | Otherwise |
| #ff9999 | #ffdb99 | #99cc99 |
Design Resources:
| Border Effect | 1px solid #808080 |
| Background (th) | #a8a8a8 |
| Background (:nth-child) | #e0e0e0 |
Please Note:
- You must use the attribute values contained within the XML file where appropriate.
- Each of the CSS rulesets provided in the template should be used within your final design.
- Be sure to include an appropriate/descriptive name for each of your ‘class’ selectors.
- Use indentation within your code to improve its overall readability.
You will need to submit both the “A3_TASK4.xml” file and the XSLT file, which should be named “A3_TASK4.xsl”, to the submission facility on Moodle for this task. These will complete the set of 5 separate files that you must submit for this assignment.
Please ask your teacher if you are uncertain about the submission requirements for this assignment.
This task is worth 3 marks.
The following applies to all relevant components of your submission:
| Additional Marking Criteria | Available Marks |
| XML documents validate without issue(s) using the specified validation service | 1.0 |
| XSL file displays XML content correctly and without issue(s) in Google Chrome | 0.5 |
| All code is neat and suitably indented (2 Spaces Only) | 0.25 |
| Documents contain explanatory commenting where appropriate | 0.25 |
– THIS IS THE END OF THE ASSIGNMENT –
Version 2.2 by Jason Rodriguez
The post DPIT128: Introduction to Web Technology appeared first on My Assignment Online.