You are on page 1of 2

Assignment No.

02
Total Marks: 20
Semester: Fall 2017
Introduction to Web Services Development CS311 Due Date: 24/11/2017

Objectives:
Understand and get hands on experience of
PHP server side script
Nested loops in PHP
Reading XML elements in PHP
Display XML element into HTML table
Instructions:
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:

The assignment is submitted after due date.


The assignment is submitted via email.
The assignment is copied from Internet or from any other student.
The submitted assignment does not open or file is corrupt.
It is in some format other than .php(PHP Code File).

Note: All types of plagiarism are strictly prohibited.

For any query about the assignment, contact at CS311@vu.edu.pk

Problem Statement
Well-formed code of XML is given below which is showing picture book list in XML format. You
are required to write PHP code which will read given XML code and display in HTML table as
showing in screen shot of sample output.

<?xml version='1.0' encoding='UTF-8'?>


<Picture_Books>
<Book>
<title>Where The Wild Things Are</title>
<illustrator>Maurice Sendak</illustrator>
<price>$ 120</price>
</Book>
<Book>
<title>Dorrie And The Blue Witch</title>
<illustrator>Patricia Coombs</illustrator>
<price>$ 80</price>
</Book>
<Book>
<title>Foot Book</title>
<illustrator>Theodor Geisel</illustrator>
<price>$ 75</price>
</Book>
<Book>
<title>Eye Book</title>
<illustrator>Roy Mckie</illustrator>
<price>$ 125</price>
</Book>
<Book>
<title>Hop On Pop</title>
<illustrator>Theodor Geisel</illustrator>
<price>$ 100</price>
</Book>

</Picture_Books>

Sample Output:

Assignment Uploading Instructions:

You need to upload PHP file that contain solution of this assignment. The procedure to use online tool
to write, compile, test PHP code and export as PHP file is given in demo.mp4 video file.

Tips: Create a string of whole XML code and use built-in PHP function simplexml_load_string( ) to
get object. Convert object into array and display information in array in HTML table.

Please note that due date of assignment will not extend, so do not wait for last date and submit your
solution as quickly as possible.