-
Book Overview & Buying
-
Table Of Contents
PHP jQuery Cookbook
By :
This recipe will explain how we can get the values of the node and/or attributes from an XML file using SimpleXML methods. We will write an example using our common.xml file that will be used to get the publication year or list of stories in a selected book.
Create a folder for this recipe in the Chapter3 directory and name it as Recipe2.
Create a new file named index.php in Recipe2 folder. In this file, create a select box and create its options, which will be the names of books in the common.xml file. Next, create two buttons that will get the publication year and list of stories in the selected book. Each of these buttons has an ID attribute that will be used to distinguish between the clicked buttons. After that, create a paragraph element to display the result.
<html> <head><title>Accessing node and attribute values</title></head> <body> <p> <select id="bookList...
Change the font size
Change margin width
Change background colour