< Back
Page 8 of 8
This chapter is from the book
Programming Exercises
These exercises assume that you have a file called aliens.xml with the following content:
<?xml version="1.0"?> <aliens> <alien> <classification>GS3</classification> <species>Isaboreans</species> <planet>Isabore 3</planet> <range confirmed="yes">3000000</range> </alien> <alien> <classification>PPW</classification> <species>Rowaria</species> <planet>Roware 9</planet> <range confirmed="no">400000</range> </alien> <alien> <classification>IOPO</classification> <species>Discoria</species> <planet>Bearost 4</planet> <range confirmed="yes">9000</range> </alien> </aliens>
Using your chosen language, create a Document object.
Alter your application to retrieve the root element and output its name.
Display the species names.
For each alien element, display the name and text of each element node.
Make sure all confirmed attributes have a value of yes.
< Back
Page 8 of 8