IWT CW2.
The purpose of this coursework is to help you learn about using server-side PHP to process XML documents and return results over the web. The coursework will be assessed and counts 10% of the final mark for this module. The task The XML document you will be working with is cia.xml, which is an XML representation of parts of The World Factbook, published by the CIA. The data was taken from a GitHub repository, last updated in 2013. Some of the data is incomplete, and some non-matching end-tags had to be corrected. The XML document referenced above contains information on only 12 countries in Europe. You should save the XML file to the directory where you plan to develop your solution. You should also take time to study the structure of the XML file and note the following: ?The top-level element is countries which contains the 12 country elements. ?Each country element has name and people elements as children (among many others). ?Each people element has population and languages elements as children. ?Each population element has total, birth and death children. Note that the total population is represented in thousands of people. The birth and death elements represent birth and death rates, respectively, in numbers per 1000. The product of the coursework should be an HTML page which a user can use to query information about the countries contained in the XML file. You should use an HTML form, along with PHP on the server, to implement your solution, which should work in any browser since the HTML will comprise only a simple form. The techniques you need to use are discussed in the Extensible style language and Server-side processing parts of the module. Extra information is given below. The tasks you need to perform are as follows: 1.The PHP script always returns an HTML page which contains a table of information about the countries satisfying the conditions entered by the user on the "querying" web page. 2.On the "querying" web page, the user should be able to select (by using checkboxes) which information, out of total population (total), birth rate (birth) and death rate (death), they want displayed for each country. The names of countries should always be displayed in the table returned by PHP. That table should contain a header row which contains "Country" (for the name), along with appropriate column headers for any other information selected by the user. 3.For population, the user should be able to enter a value in a text box, as well as select a comparison operator (less than, greater than, or none) from a drop-down list, and have returned returned in the table only those countries whose population values satisfy the condition. 4.The user should be able to specify whether they want countries whose birth rate is less than their death rate, greater than their death rate, or not specified. 5.By specifying a value in a text box, the user should be able to have returned only countries where the value appears somewhere in the languages element (the intension is that the user will enter a language, e.g., Dutch, but any string can be entered by the user and only case-sensitive matching need be implemented). 6.The user should be able to specify conditions on any combination of the above, i.e., population, birth/death rate and languages, and have only the countries satisfying all of the conditions returned. Handing in the coursework The deadline for submission is 6pm on Tuesday 13th April 2021. Please submit the coursework via Moodle as a single zip file containing your HTML and PHP files. You should not submit any instructions or explanations in a separate file. Instead, the interface should be self explanatory and the code should be commented appropriately. Remember that plagiarism is taken very seriously by the Department and the College (see the relevant section in your programme booklet). By submitting the coursework, you are implicitly declaring that your coursework is entirely your own work, except where explicitly stated otherwise. (Of course, you are welcome to reuse code presented during lectures; any other code that is not yours should be acknowledged in comments.) Your submission may be submitted to an online plagiarism detection service. The College’s disciplinary procedure will be invoked in any cases of suspected plagiarism. The College policy with regard to late submission of coursework is described in the MSc/MRes programme booklet. No extensions will be granted. The cut-off date for submissions is 6pm on Tuesday 27th April 2021. Submissions after this date will not be marked. Where mitigating circumstances are not accepted, those submitted after 6pm on the 13th and before 6pm on the 20th April will have their mark reduced by 10%, while those received after 6pm on the 20th April and before 6pm on the 27th April will receive a maximum mark of 50%. Marking guide Your PHP program should be properly structured and should include comments and some simple error checking. Marks will be awarded out of 20. The areas in which marks will be awarded and the maximum mark possible in each case are as follows: PHP code structure and comments2 error handling in the code1 part 11 part 22 part 34 part 44 part 54 part 62 Full marks for the first 2 items above will not be awarded if only a partial solution is provided for the other parts. Comments on your coursework, along with the mark you were awarded, should be returned to you within 4 weeks of the cut-off date. Hints and useful information ?You can use your Departmental web space and the Department’s titan web server for testing your solution. Alternatively, you could install XAMPP on your personal machine. XAMPP is a PHP development environment which includes Apache, MariaDB, PHP and Perl. ?I suggest that you use the GET method to send values to the server. This means that checks can be run simply by changing the URI sent. ?An HTML form checkbox uses the following syntax: <input type="checkbox" id="x" name="y" value="z"/> ?If the user selects this box, then y=z will be appended to the URI (assuming that GET was used); otherwise nothing will be sent for this checkbox. ?In PHP, you can check whether a variable has been declared and has a non-null value by using the function isset. ?You can use XPath in PHP to select and filter elements in an XML document. Using XPath should lead to a simple, elegant solution. One way of using XPath is to use the SimpleXML function simplexml_load_file to load the XML file and return an object in the class SimpleXMLElement. Such an object can have the xpath method applied to it. This method takes a string representing an XPath expression as argument and returns an array of SimpleXMLElement objects. ?In XPath, the contains function can be used to test whether an element contains a string in it. It takes two arguments: the first is the element to test; the second is the string. ?In PHP, . is used for concatenation. ?It might be helpful to use XSLT to test sample XPath expressions you might construct in PHP, checking that they do indeed return what you expect on the XML file.

Order Management
Discount

WHY CHOOSE US?
Time-tested quality
Master’s and Ph.D. writers
The expert team of editors
100% plagiarism-free papers
Set of Free features
Talk to your writer directly
Get FREE revision upon request
24/7 Customer Support Department
100% Money-Back guarantees
order now

Recent Post
Format and Features
- At least 275 words per page
- Free inquiry
- Free title page
- Free outline
- Free bibliography
- Free plagiarism report
- Free unlimited revisions
- Instant email delivery
- Flexible prices and discounts
Professional academic writer
