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
Recipe2folder. In this file, create a select box and create its options, which will be the names of books in the
common.xmlfile. 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 ...