XOM makes XML Easier
Please turn off all
Outline
A few opinions
Current version
Why Me?
Four Styles of XML API
Push APIs
Pull APIs
Data Binding APIs
Tree APIs
DOM
DOM Ugliness
Reasons for DOM Ugliness
What I learned from DOM
JDOM
Is JDOM too Java-centric?
What I learned from JDOM
dom4j
Conclusion: We can do better
nu.xom: A New XML Object Model
Design Goals
Design Principles
Principles of API Design
XML Principles
Java Design Principles
Development Style
Create and serialize a document
FibonacciXML Output
Parsing a document
The Node Class
Example: PropertyPrinter
PropertyPrinter Output
Example: TreeReporter
TreeReporter Output
The Document Class
Example: Validating XHTML
Verify Root Element is html in the XHTML namespace
The Element Class
Element Constructors:
Element Properties
Methods to get child elements
The Elements class
Recursive Descent
Example: TreeViewer
Attribute Methods on Element
Example: IDTagger
Additional Namespaces
Enumerating Namespaces
The Text Class
ROT13XML
ROT13XML Output
The Attribute Class
Attribute Constructors
Attribute Getter and Setter Methods
Example: XLinkSpider
XLinkSpider Output
Attribute.Type
The ProcessingInstruction Class
Example: PoliteSpider
The DocType Class
Validating XHTML
Three XHTML DTDs:
XHTMLValidator
XHTMLValidator Output
The Comment Class
Example: CommentReader
CommentReader Output
The Builder Class
Example: Schema Validating
Serializer
Example: Pretty Printing
Encoding
Connecting to other Models
The Wrong Side of 80/20
Subclassing
NodeFactory
Factories
Processing Arbitrarily Large Documents
Streaming Processing of Large Documents
Output of RSS Headlines
Performance
Candidates for Optimization
How does XOM differ from JDOM?
In JDOM's Favor
In XOM's Favor
XOM is simpler!
Future Directions
Props
To Learn More
Questions?
Entire Presentation as Single File
Start
|
Cafe con Leche
Copyright 2004 Elliotte Rusty Harold
Last Modified February 4, 2004