Home > Articles

  • Print
  • + Share This
This chapter is from the book

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"?>
    <planet>Isabore 3</planet>
    <range confirmed="yes">3000000</range>

    <planet>Roware 9</planet>
    <range confirmed="no">400000</range>

    <planet>Bearost 4</planet>
    <range confirmed="yes">9000</range>

  1. Using your chosen language, create a Document object.

  2. Alter your application to retrieve the root element and output its name.

  3. Display the species names.

  4. For each alien element, display the name and text of each element node.

  5. Make sure all confirmed attributes have a value of yes.

  • + Share This
  • 🔖 Save To Your Account