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

Working with XML: Table of Contents

Part I: Understanding XML and the Java XML APIs
1. A Quick Introduction to XML
What is XML?
Tags and Attributes
Empty Tags
Comments in XML Files
The XML Prolog
Processing Instructions
 
Why is XML Important?
What can you do with XML?
 
2. XML and Related Specs: Digesting the Alphabet Soup
W3C Recommendations
SAX
DOM
DTD
RDF
Namespaces
W3C Proposed Recommendations
RDF Schema
W3C Working Drafts
XSL
XLL
XLink
XPointer
XHTML
XML Schema
W3C "Notes"
Schema Proposals
DDML / XSchema
DCD
SOX
Other W3C Notes
ICE
Standards that Build on XML
SMIL
MathML
SVG
DrawML
eCommerce Standards
cXML
CBL
Software Administration and Maintenance Standards
DMTF
WebDAV

3. An Overview of the APIs
The JAXP APIs
An Overview of SAX and DOM
The SAX Parser
3b. Other SAX APIs
The Document Object Model (DOM)
The Project X Reference Implementation
Where Do You Go from Here?
 
 
4. Designing an XML Data Structure
Saving Yourself Some Work
Attributes and Elements
Forced Choices
Stylistic Choices
Normalizing Data
Normalizing DTDs
 
 
Part II: Serial Access with the Simple API for XML (SAX)
1. Writing a Simple XML File
Creating the File
Writing the Declaration
Adding a Comment
Defining the Root Element
Adding Attributes to an Element
Adding Nested Elements
Adding HTML-Style Text
Adding an Empty Element
The Finished Product
 
2a. Echoing an XML File with the SAX Parser
Create the Skeleton
Import the Classes We Need
Setting up for I/O
Setting up the Parser
Implementing the DocumentHandler Interface
Writing the Output
Spacing the Output
Handling Document Events
Compiling the Program
Running the Program
Command Scripts
Checking the Output
Identifying the Events
Compressing the Output
Inspecting the Output
Documents and Data
 
2b. Adding Additional Event Handlers
Identifying the Document's Location
Handling Processing Instructions
Summary
 
3. Handling Errors with the Nonvalidating Parser
Introducing an Error
Handling a SAXParseException
Handling a SAXException
Improving the SAXParseException Handler
Handling a ParserConfigurationException
Handling an IOException
Understanding NonFatal Errors
Handling NonFatal Errors
Handling Warnings
 
4. Substituting and Inserting Text
Handling Special Characters
Predefined Entities
Character References
Using an Entity Reference in an XML Document
Handling Text with XML-Style Syntax
Handling CDATA and Other Characters
 
5a. Creating a Document Type Definition (DTD)
Basic DTD Definitions
Defining Text and Nested Elements
Limitations of DTDs
Special Element Values in the DTD
Referencing the DTD
 
5b. DTD's Effect on the Nonvalidating Parser
Tracking Ignorable Whitespace
Cleanup
Documents and Data
Empty Elements, Revisited
 
5c. Defining Attributes and Entities in the DTD
Defining Attributes in the DTD
Defining Entities in the DTD
Echoing the Entity References
Additional Useful Entities
Referencing External Entities
Echoing the External Entity
Summarizing Entities
 
5d. Referencing Binary Entities
Using a MIME Data Type
The Alternative: Using Entity References
 
6. Using the Validating Parser
Configuring the Factory
Using an Environment Variable
Experimenting with Validation Errors
Error Handling in the Validating Parser
 
7a. Defining Parameter Entities and Conditional Sections
Creating and Referencing a Parameter Entity
Conditional Sections
 
7b. Parsing the Parameterized DTD
DTD Warnings
 
8. Using a LexicalEventListener
How the LexicalEventListener Works
Working with a LexicalEventListener
Echoing Comments
Echoing Other Lexical Information
 
9. Using the DTDHandler and EntityResolver
The DTDHandler API
The EnityResolver API
Part III: XML and the Document Object Model (DOM)
1. Generating a DOM from XML data
Reading an XML Document into a DOM
Create the Skeleton
Import the Required Classes
Declare the DOM
Handle Errors
Instantiate the Factory
Get a Parser and Parse the File
Write Out the XML
Use XmlDocument
Run the Program
Additional Information
Configuring the Factory
Handling Validation Errors
Looking Ahead
 
2. Generating XML from an Arbitrary Data Structure
How It Works
Modify the "Parser" to Generate SAX Events
Implement the org.xml.sax.Parser Interface
Create a Factory
Wire Your "Parser" to an XmlDocumentBuilder
Write it Out
Run It
 
3a. Displaying a DOM Hierarchy
Echoing Tree Nodes
Convert DomEcho to a GUI App
Add Import Statements
Create the GUI Framework
Add the Display Components
Create Adapters to Display the DOM in a JTree
Define the AdapterNode Class
Define the TreeModel Adapter
Finish it Up
 
3b. Examining the Structure of a DOM
Displaying a Simple Tree
Displaying a More Complex Tree
Finishing Up
 
4. Constructing a User-Friendly JTree from a DOM
Compressing the Tree View
Make the Operation Selectable
Identify "Tree" Nodes
Control Node Visibility
Control Child Access
Check the Results
Extra Credit
Acting on Tree Selections
Identify Node Types
Concatenate Subnodes to Define Element Contents
Display the Content in the JTree
Wire the JTree to the JEditorPane
Run the App
Extra Credit
Handling Modifications
Finishing Up
 
5. Creating and Manipulating a DOM
Obtaining a DOM from the Factory
Modify the Code
Create Element and Text Nodes
Run the App
Normalizing the DOM
Other Operations
Traversing Nodes
Creating Attributes
Removing and Changing Nodes
Finishing Up
 
6. Using Namespaces
Defining a Namespace
Referencing a Namespace
Defining a Namespace Prefix
 
Additional Information
Java's Encoding Schemes
Previous | Next | Index | TOC | Top | Top Contents Index Glossary