did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780201771862

Processing XML with Java¿ A Guide to SAX, DOM, JDOM, JAXP, and TrAX

by
  • ISBN13:

    9780201771862

  • ISBN10:

    0201771861

  • Edition: 1st
  • Format: Paperback
  • Copyright: 2002-11-05
  • Publisher: Addison-Wesley Professional
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $64.99

Summary

A complete guide to writing Java programs that read and write XML documents. Shows developers how to save XML documents, read XML documents, communicate with network servers that send and receive XML data, and integrate XSLT into their programs. Softcover.

Author Biography

Elliotte Rusty Harold is an internationally respected writer, programmer, and educator. He is an Adjunct Professor of Computer Science at Polytechnic University in Brooklyn, where he lectures on Java and object-oriented programming. His Cafe con Leche Web site has become one of the most popular sites for information on XML. In addition, he is the author and coauthor of numerous books, the most recent of which are The XML Bible (John Wiley & Sons, 2001) and XML in a Nutshell (O'Reilly, 2002).



0201771861AB06062003

Table of Contents

List of Examples
xvii
List of Figures
xxvii
Preface xxix
Who You Are xxxi
What You Need to Know xxxii
What You Need to Have xxxii
How to Use This Book xxxiii
The Online Edition xxxiv
Some Grammatical Notes xxxiv
Contacting the Author xxxvi
Acknowledgments xxxvii
Part I XML 1(256)
XML for Data
3(54)
Motivating XML
3(10)
A Thought Experiment
4(2)
Robustness
6(3)
Extensibility
9(2)
Ease-of-Use
11(2)
XML Syntax
13(19)
XML Documents
13(2)
XML Applications
15(1)
Elements and Tags
16(3)
Text
19(2)
Attributes
21(1)
XML Declaration
22(1)
Comments
23(1)
Processing Instructions
24(1)
Entities
25(3)
Namespaces
28(4)
Validity
32(11)
DTDs
32(5)
Schemas
37(4)
Schematron
41(2)
The Last Mile
43(1)
Stylesheets
43(10)
CSS
44(1)
Associating Stylesheets with XML Documents
45(1)
XSL
46(7)
Summary
53(4)
XML Protocols: XML-RPC and SOAP
57(64)
XML as a Message Format
58(6)
Envelopes
58(1)
Data Representation
59(5)
HTTP as a Transport Protocol
64(9)
How HTTP Works
65(3)
HTTP in java
68(5)
RSS
73(4)
Customizing the Request
77(5)
Query Strings
77(4)
How HTTP POST Works
81(1)
XML-RPC
82(14)
Data Structures
85(4)
Faults
89(1)
Validating XML-RPC
90(6)
SOAP
96(22)
A SOAP Example
97(1)
Posting SOAP Documents
98(2)
Faults
100(2)
Encoding Styles
102(10)
SOAP Headers
112(4)
SOAP Limitations
116(1)
Validating SOAP
117(1)
Custom Protocols
118(1)
Summary
119(2)
Writing XML with Java
121(30)
Fibonacci Numbers
122(2)
Writing XML
124(8)
Better Coding Practices
125(2)
Attributes
127(1)
Producing Valid XML
128(2)
Namespaces
130(2)
Output Streams, Writers, and Encodings
132(7)
A Simple XML-RPC Client
139(3)
A Simple SOAP Client
142(3)
Servlets
145(4)
Summary
149(2)
Converting Flat Files to XML
151(60)
The Budget
152(2)
The Model
154(2)
Input
156(3)
Determining the Output Format
159(15)
Validation
165(4)
Attributes
169(5)
Building Hierarchical Structures from Flat Data
174(17)
Alternatives to Java
191(10)
Imposing Hierarchy with XSLT
193(3)
The XML Query Language
196(5)
Relational Databases
201(7)
Summary
208(3)
Reading XML
211(46)
InputStreams and Readers
211(5)
XML Parsers
216(13)
Choosing an XML API
218(4)
Choosing an XML Parser
222(4)
Available Parsers
226(3)
SAX
229(5)
DOM
234(4)
JAXP
238(4)
JDOM
242(4)
dom4j
246(2)
ElectricXML
248(3)
XMLPULL
251(3)
Summary
254(3)
Part II SAX 257(174)
SAX
259(46)
What Is SAX?
259(1)
Parsing
260(4)
Callback Interfaces
264(7)
Implementing ContentHandler
265(2)
Using the ContentHandler
267(3)
The DefaultHandler Adapter Class
270(1)
Receiving Documents
271(2)
Receiving Elements
273(6)
Handling Attributes
279(5)
Receiving Characters
284(4)
Receiving Processing Instructions
288(3)
Receiving Namespace Mappings
291(4)
``Ignorable White Space''
295(1)
Receiving Skipped Entities
296(2)
Receiving Locators
298(5)
What the ContentHandler Doesn't Tell You
303(1)
Summary
304(1)
The XMLReader Interface
305(62)
Building Parser Objects
305(4)
Input
309(6)
InputSource
309(3)
EntityResolver
312(3)
Exceptions and Errors
315(10)
SAXExceptions
316(5)
The ErrorHandler Interface
321(4)
Features and Properties
325(30)
Getting and Setting Features
325(1)
Getting and Setting Properties
326(1)
Required Features
327(3)
Standard Features
330(5)
Standard Properties
335(12)
Xerces Custom Features
347(6)
Xerces Custom Properties
353(2)
DTDHandler
355(10)
Summary
365(2)
SAX Filters
367(64)
The Filter Architecture
367(3)
The XMLFilter Interface
370(14)
Content Filters
384(23)
Filtering Tags
384(9)
Filtering Elements
393(4)
Filtering Attributes
397(2)
Filters That Add Content
399(6)
Filters versus Transforms
405(2)
The XMLFilterImpl Class
407(4)
Parsing Non-XML Documents
411(9)
Multihandler Adapters
420(8)
Summary
428(3)
Part III DOM 431(210)
The Document Object Model
433(60)
The Evolution of DOM
434(1)
DOM Modules
435(4)
Application-Specific DOMs
439(1)
Trees
440(12)
Document Nodes
442(1)
Element Nodes
443(1)
Attribute Nodes
444(1)
Leaf Nodes
445(2)
Nontree Nodes
447(2)
What Is and Isn't in the Tree
449(3)
DOM Parsers for Java
452(3)
Parsing Documents with a DOM Parser
455(13)
JAXP DocumentBuilder and DocumentBuilderFactory
458(8)
DOM3 Load and Save
466(2)
The Node Interface
468(14)
Node Types
470(2)
Node Properties
472(3)
Navigating the Tree
475(3)
Modifying the Tree
478(3)
Utility Methods
481(1)
The NodeList Interface
482(1)
JAXP Serialization
483(3)
DOMException
486(3)
Choosing between SAX and DOM
489(3)
Summary
492(1)
Creating XML Documents with DOM
493(46)
DOMImplementation
493(2)
Locating a DOMImplementation
495(4)
Implementation-Specific Class
495(1)
JAXP DocumentBuilder
496(1)
DOM3 DOMImplementationRegistry
497(2)
The Document Interface as an Abstract Factory
499(14)
The Document Interface as a Node Type
513(21)
Getter Methods
513(4)
Finding Elements
517(16)
Transferring Nodes between Documents
533(1)
Normalization
534(4)
Summary
538(1)
The DOM Core
539(58)
The Element Interface
539(12)
Extracting Elements
541(7)
Attributes
548(3)
The NamedNodeMap Interface
551(7)
The CharacterData Interface
558(5)
The Text Interface
563(5)
The CDATASection Interface
568(3)
The EntityReference Interface
571(2)
The Attr Interface
573(3)
The ProcessingInstruction Interface
576(5)
The Comment Interface
581(3)
The DocumentType Interface
584(2)
The Entity Interface
586(4)
The Notation Interface
590(4)
Summary
594(3)
The DOM Traversal Module
597(20)
NodeIterator
597(8)
Constructing Nodelterators with DocumentTraversal
599(4)
Liveness
603(1)
Filtering by Node Type
604(1)
NodeFilter
605(5)
TreeWalker
610(6)
Summary
616(1)
Output from DOM
617(24)
Xerces Serialization
617(2)
OutputFormat
619(8)
DOM Level 3
627(13)
Creating DOMWriters
632(3)
Serialization Features
635(1)
Filtering Output
636(4)
Summary
640(1)
Part IV JDOM 641(110)
JDOM
643(44)
What Is JDOM?
644(3)
Creating XML Elements with JDOM
647(2)
Creating XML Documents with JDOM
649(2)
Writing XML Documents with JDOM
651(5)
Document Type Declarations
656(3)
Namespaces
659(5)
Reading XML Documents with JDOM
664(4)
Navigating JDOM Trees
668(7)
Talking to DOM Programs
675(1)
Talking to SAX Programs
676(5)
Configuring SAXBuilder
676(3)
SAXOutputter
679(2)
Java Integration
681(2)
Serializing JDOM Objects
681(1)
Synchronizing JDOM Objects
681(1)
Testing Equality
681(1)
Hash Codes
682(1)
String Representations
683(1)
Cloning
683(1)
What JDOM Doesn't Do
683(1)
Summary
684(3)
The JDOM Model
687(64)
The Document Class
688(2)
The Element Class
690(29)
Constructors
693(1)
Navigation and Search
694(20)
Attributes
714(5)
The Attribute Class
719(5)
The Text Class
724(5)
The CDATA Class
729(1)
The ProcessingInstruction Class
730(3)
The Comment Class
733(3)
Namespaces
736(3)
The DocType Class
739(6)
The EntityRef Class
745(3)
Summary
748(3)
Part V XPath/XSLT 751(116)
XPath
753(52)
Queries
754(2)
The XPath Data Model
756(3)
Location Paths
759(13)
Axes
761(3)
Node Tests
764(2)
Predicates
766(2)
Compound Location Paths
768(1)
Absolute Location Paths
769(1)
Abbreviated Location Paths
770(2)
Combining Location Paths
772(1)
Expressions
772(6)
Literals
773(1)
Operators
774(1)
Functions
774(4)
XPath Engines
778(11)
XPath with Saxon
781(4)
XPath with Xalan
785(4)
DOM Level 3 XPath
789(10)
Namespace Bindings
794(3)
Snapshots
797(1)
Compiled Expressions
798(1)
Jaxen
799(5)
Summary
804(1)
XSLT
805(62)
XSL Transformations
805(17)
Template Rules
806(1)
Stylesheets
807(1)
Taking the Value of a Node
808(3)
Applying Templates
811(1)
The Default Template Rules
812(1)
Selection
813(2)
Calling Templates by Name
815(7)
TrAX
822(28)
Thread Safety
824(3)
Locating Transformers
827(1)
The xml-stylesheet Processing Instruction
828(3)
Features
831(3)
XSLT Processor Attributes
834(2)
URI Resolution
836(1)
Error Handling
837(3)
Passing Parameters to Stylesheets
840(2)
Output Properties
842(3)
Sources and Results
845(5)
Extending XSLT with Java
850(15)
Extension Functions
851(11)
Extension Elements
862(3)
Summary
865(2)
Part VI Appendixes 867(126)
Appendix A XML API Quick Reference
869(100)
SAX
869(1)
org.xml.sax
870(10)
org.xml.sax.ext
880(2)
org.xml.sax.helpers
882(9)
DOM
891(1)
The DOM Data Model
892(2)
org.w3c.dom
894(14)
org.w3c.dom.traversal
908(4)
JAXP
912(1)
javax.xml.parsers
912(5)
TrAX
917(1)
javax.xml.transform
917(7)
javax.xml.transform.stream
924(2)
javax.xml.transform.dom
926(1)
javax.xml.transform.sax
927(3)
JDOM
930(1)
org.jdom
930(17)
org.jdom.filter
947(3)
org.jdom.input
950(7)
org.jdom.output
957(5)
org.jdom.transform
962(2)
org.jdom.xpath
964(1)
XMLPULL
964(1)
org.xmlpull.v1
965(4)
Appendix B SOAP 1.1 Schemas
969(20)
The SOAP 1.1 Envelope Schema
969(4)
The SOAP 1.1 Encoding Schema
973(13)
W3C Software Notice and License
986(3)
Appendix C Recommended Reading
989(4)
Books
989(1)
Specifications
990(3)
Index 993

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Excerpts

One night five developers, all of whom wore very thick glasses and had recently been hired by Elephants, Inc., the world's largest purveyor of elephants and elephant supplies, were familiarizing themselves with the company's order processing system when they stumbled into a directory full of XML documents on the main server. "What's this?" the team leader asked excitedly. None of them had ever heard of XML before, so they decided to split up the files among them and try to figure out just what this strange and wondrous new technology was. The first developer, who specialized in optimizing Oracle databases, printed out a stack of FMPXMLRESULT documents generated by the FileMaker Pro database where all the orders were stored, and began poring over them. "So this is XML! Why, it's nothing novel. As anyone can see who's able, an XML document is nothing but a table!" "What do you mean, a table?" replied the second developer, well versed in object-oriented theory and occupied with a collection of XMI documents that encoded UML diagrams for the system. "Even a Visual Basic programmer could see that XML documents aren't tables. Duplicates aren't allowed in a table relation, unless this is truly some strange mutation. Classes and objects are what these documents are. Indeed, it should be obvious on the very first pass. An XML document is an object, and a DTD is a class." "Objects? A strange kind of object, indeed!" said the third developer, a web designer of some renown, who had loaded the XHTML user documentation for the order processing system into Mozilla."I don't see any types at all. If you think this is an object, then it's your software I refuse to install. But with all those stylesheets there, it should be clear to anyone not sedated that XML is just HTML updated!" "HTML? You must be joking" said the fourth, a computer science professor on sabbatical from MIT, who was engrossed in an XSLT stylesheet that validated all of the other documents against a Schematron schema. "Look at the clean nesting of hierarchical structures, each tag matching its partner as it should. I've never seen HTML that looks this good. What we have here is S-expressions, which is certainly nothing new. Babbage invented this back in 1882!" "S-expressions?" queried the technical writer, who was occupied with documentation for the project, written in DocBook. "Maybe that means something to those in your learned profession. But to me, this looks just like a FrameMaker MIF file. However, locating the GUI does seem to be taking me a while." And so they argued into the night, none of them willing to give an inch, all of them presenting still more examples to prove their points, but none bothering to look at the others' examples. Indeed, they're probably still arguing today. You can even hear their shouts from time to time on xml-dev. Their mistake, of course, was in trying to force XML into the patterns of technologies they were already familiar with rather than taking it on its own terms. XML can store data, but it is not a database. XML can serialize objects, but an XML document is not an object. Web pages can be written in XML, but XML is not HTML. Functional (and other) programming languages can be written in XML, but XML is not a programming language. Books are written in XML, but that doesn't make XML desktop publishing software. XML is something truly new that has not been seen before in the world of computing. There have been precursors to it, and there are always fanatics who insist on seeing XML through database (or object, or functional, or S-expression) colored glasses. But XML is none of these things. It is something genuinely unique and new in the world of computing; and it's possible to understand it only when you're willing to accept it on its own terms, rather than forcing it into yesterday's pigeonholes. There are a lot of tools, APIs, and applications in the world that pretend XML is something more famil

Rewards Program