Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax Free Open Book

Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax

Previous Section Next Section

What the ContentHandler Doesn't Tell You

The ContentHandler interface is designed to provide everything most applications need to know about an XML instance document. What it leaves out are things you rarely care about, although most of these are available through other callback interfaces discussed in the next chapter. These include

  • Comments, unskipped entities, and CDATA sections, all of which are available through the LexicalHandler interface

  • The names, public IDs, system IDs, and notations for unparsed entities; and the names, public IDs, and system IDs for notations—all of which are available through the DTDHandler interface

  • ELEMENT, ATTLIST, and parsed ENTITY declarations from the DTD, all of which are reported through the DeclHandler interface

  • Validity errors and other nonfatal errors, which are reported through the ErrorHandler interface

The only things that truly aren't available in SAX2, even after all optional extensions are included, are

  • The version, encoding, and standalone attributes from the XML declaration

  • (scheduled to be added in SAX 2.1)

  • Insignificant white space in tags and before and after the root element

  • The order of attributes

  • The type of quotes that surround attributes

  • Character references

  • Prenormalized attribute values

  • Whether an attribute was specified in the instance document or defaulted in from the DTD or schema

  • Whether empty elements are represented as <name></name> or <name />

  • Skipped entities in attribute values

The only common use case for most of this information would be an XML editor. Editors are quite strange beasts compared with most client applications, and they really require a custom parser and API. None of the standard APIs or parsers provide all of the information an editor needs.

    Previous Section Next Section


         Main Menu
    Main Page
    Table of content
    Copyright
    Praise for Elliotte Rusty Harold's 'Processing XML with Java™'
    List of Examples
    List of Figures
    Preface
    Part I: XML
    Part II: SAX
    Chapter 6. SAX
    What Is SAX?
    Parsing
    Callback Interfaces
    Receiving Documents
    Receiving Elements
    Handling Attributes
    Receiving Characters
    Receiving Processing Instructions
    Receiving Namespace Mappings
    'Ignorable White Space'
    Receiving Skipped Entities
    Receiving Locators
    What the ContentHandler Doesn't Tell You
    Summary
    Chapter 7. The XMLReader Interface
    Chapter 8. SAX Filters
    Part III: DOM
    Part IV: JDOM
    Part V: XPath/XSLT
    Part VI: Appendixes


    More Books
    PHP Hacks
    Processing Xml With Java - A Guide To Sax, Dom, Jdom, Jaxp, And Trax
    The Koran (Holy Qur'an)
    Macromedia Flash 8 Bible
    Search Engine Optimization for Dummies
    YouTube Traffic
    PHP 5 for Dummies
    Harry Potter and The Chamber of Secrets
    Harry Potter and the Sorcerer's Stone
    The Pilgrim's Progress
    Wireless Hacks
    Flash Hacks. 100 Industrial-Strength Tips & Tools
    PayPal Hacks. 100 Industrial-Strength Tips and Tools
    Amazon Hacks
    Pdf Hacks
    The Da Vinci Code
    Google Hacks
    The Holy Bible
    Windows XP For Dummies
    Harry Potter and the Half-Blood Prince
    Seo Book
    Upgrading and Repairing Networks
    Macromedia Dreamweaver 8 UNLEASHED
    Windows XP Annoyances
    Windows XP Hacks
    Microsoft Windows XP Power Toolkit
    Teach Yourself MS Office In 24Hours
    iPod & iTunes Missing Manual
    PC Hacks 100 Industrial-Strength Tips and Tools
    PC Overclocking, Optimization, and Tuning - 2th Edition
    PC Hardware In A Nutshell 3rd Edition
    PC Hardware in a Nutshell, 2nd Edition
    Upgrading and Repairing PCs
    Google for Dummies
    MySQL Cookbook
    Teach Yourself Macromedia Flash 8 In 24 Hours
    PHP CookBook
    Sams Teach Yourself JavaScript in 24 Hours
    PHP5 Manual
    Free Games Paper Airplanes
    500 Juegos Gratis 500 Giochi Gratis 500 Jeux Gratuits 500 Jogos Gratis 500 Kostenlose Spiele