Previous | Next | Index | TOC | Top | Top Contents Index Glossary


Part III: XML and the Document Object Model (DOM)

Link Summary
API Links

External Links

Glossary Terms

DOM, element, SAX

In the SAX section of the tutorial, you wrote an XML file that contains slides for a presentation. You then used the Simple API for XML (SAX) API to echo the XML to your display.

In this section of the tutorial, you'll use the Document Object Model (DOM) to build a small SlideShow application. You'll start by constructing a DOM and inspecting it, then see how to write a DOM as an XML structure, display it in a GUI, and manipulate the tree structure.

Overview of the Document Object Model

A Document Object Model is a garden-variety tree structure, where each node contains one of the components from an XML structure. The two most common types of nodes are element nodes and text nodes. Using DOM functions lets you create nodes, remove nodes, change their contents, and traverse the node hierarchy.

What You'll Learn

In this section of the tutorial, you'll parse an existing XML file to construct a DOM, display and inspect the DOM hierarchy, convert the DOM into a user-friendly JTree, and explore the syntax of namespaces. You'll also create a DOM from scratch, and see how to use some of the implementation-specific features in Sun's JAXP reference implementation to convert an existing data set to XML.

This section of the tutorial covers the following topics:

  1. Generating a DOM from XML data
  2. Generating XML from an Arbitrary Data Structure
  3. a) Displaying a DOM Hierarchy
    b) Examining the Structure of a DOM
  4. Constructing a User-Friendly JTree from a DOM
  5. Creating and Manipulating DOM
  6. Using Namespaces
 

Previous | Next | Index | TOC | Top | Top Contents Index Glossary