Working with XML: Table of Contents
-
Part I: Understanding XML and the Java XML APIs
- What is XML? 2. XML and Related Specs: Digesting the Alphabet Soup
- RDF Schema W3C Working Drafts W3C "Notes" Standards that Build on XML
-
SMIL
MathML
SVG
DrawML
eCommerce Standards
-
cXML
CBL
Software Administration and Maintenance Standards
-
DMTF
WebDAV -
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
-
Predefined Entities
Character References
Using an Entity Reference in an XML Document
Handling Text with XML-Style Syntax
Handling CDATA and Other Characters
-
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
-
Echoing Comments
Echoing Other Lexical Information -
The DTDHandler API
The EnityResolver API
-
1. A Quick Introduction to XML
-
W3C Recommendations
W3C Proposed Recommendations
-
1. Writing a Simple XML File
-
Handling Special Characters
-
How the LexicalEventListener Works
Working with a LexicalEventListener
-
Part III: XML and the Document Object Model (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
-
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
-
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
-
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
-
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
-
1. Generating a DOM from XML data
-
Reading an XML Document into a DOM
-
Echoing Tree Nodes
Convert DomEcho to a GUI App
-
Compressing the Tree View
-
Obtaining a DOM from the Factory