SimpleXML is able to perform basic tasks like:
- reading XML files,
- extracting data from XML strings, and
- editing text nodes or attributes.
An XML file catalog.xml is on the right.
The program below performs the following tasks:
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<catalog>
<game>
<title>Super Mario All Stars</title>
<ASIN>B000050FBJ</ASIN>
<price>34.99</price>
<producer>Nintendo</producer>
</game>
<game>
<title>New Super Mario Bros/title>
<ASIN>B002BRZ9G0</ASIN>
<price>43.99</price>
<producer>Nintendo</producer>
</game>
<game>
<title>Super Mario Galaxy</title>
<ASIN>B002BSA388</ASIN>
<price>46.37</price>
<producer>Nintendo</producer>
</game>
...
</catalog>
|
|