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?
Why is XML Important?
What can you do with XML?
2. XML and Related Specs: Digesting the Alphabet Soup
Basic Standards
Schema Standards
Linking and Presentation Standards
Knowledge Standards
Standards that Build on XML
Extended Document Standards
eCommerce Standards
3. An Overview of the APIs
The JAXP APIs
An Overview of the Packages
The Simple API for XML (SAX) APIs
The Document Object Model (DOM) APIs
The XML Style Sheet Translation (XSLT) APIs
Overview of the JAR Files
Where Do You Go from Here?
4. Designing an XML Data Structure
Saving Yourself Some Work
Attributes and Elements
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
Creating the Skeleton
Importing Classes
Setting up for I/O
Implementing the ContentHandler Interface
Setting up the Parser
Writing the Output
Spacing the Output
Handling Content 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
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 the 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. Handling Lexical Events
How the LexicalHandler Works
Working with a LexicalHandler
9. Using the DTDHandler and EntityResolver
The DTDHandler API
The EnityResolver API
Part III: XML and the Document Object Model (DOM)
1. Reading XML data into a DOM
Creating the Program
Additional Information
Looking Ahead
2a. Displaying a DOM Hierarchy
Echoing Tree Nodes
Convert DomEcho to a GUI App
Create Adapters to Display the DOM in a JTree
Finish it Up
2b. Examining the Structure of a DOM
Displaying a Simple Tree
Displaying a More Complex Tree
Finishing Up
3. Constructing a User-Friendly JTree from a DOM
Compressing the Tree View
Acting on Tree Selections
Handling Modifications
Finishing Up
4. Creating and Manipulating a DOM
Obtaining a DOM from the Factory
Normalizing the DOM
Other Operations
Finishing Up
5. Using Namespaces
Defining a Namespace
Referencing a Namespace
Defining a Namespace Prefix
Part IV: Using XSLT
1.
Introducing XSLT and XPath
The XSLT Packages
How XPath Works
XPath Reference
2. Writing Out a DOM as an XML File
Reading the XML
Creating a Transformer
Writing the XML
Writing Out a Subtree of the DOM
Summary
3. Generating XML from an Arbitrary Data Structure
Creating a Simple File
Creating a Simple Parser
Modifying the "Parser" to Generate SAX Events
Using the Parser as a SAXSource
Doing the Conversion
4. Transforming XML Data with XSLT
Defining an Ultra-Simple
article
Document Type
Creating a Test Document
Writing an XSLT Transform
Processing the Basic Structure Elements
Writing the Basic Program
Trimming the Whitespace
Processing the Remaining Structure Elements
Process Inline (Content) Elements
Printing the HTML
What Else Can XSLT Do?
5. Concatenating XSLT Transformations with a Filter Chain
Writing the Program
Understanding How it Works
Testing the Program
Additional Information
Java's Encoding Schemes
Top
Contents
Index
Glossary