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

Chapter 9. The Document Object Model

The Document Object Model, DOM for short, is an abstract data structure that represents XML documents as trees made up of nodes. Various interfaces in the org.w3c.dom package represent elements, attributes, parsed character data, comments, and processing instructions. All of these are subinterfaces of the common Node interface, which provides basic methods for navigating and pruning the tree.

The root of the tree is a Document object that represents a complete, well-formed document. A parser reads an XML document from a stream and builds a Document object representing that XML document. The client program calls the methods of Document and the other DOM interfaces to navigate the tree and extract information from the document. Programs can also manipulate the tree in memory to add, delete, move, or change its nodes. Programs can even create completely new documents from scratch in memory, and these new documents are then written into an XML file.

DOM is defined in the Interface Definition Language (IDL); therefore, it is language neutral. DOM bindings exist for most object-oriented languages, including Java, JavaScript, C++, Python, and Perl. However, since this is a book about Java, I will deal exclusively with the Java implementation.

    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
    Part III: DOM
    Chapter 9. The Document Object Model
    The Evolution of DOM
    DOM Modules
    Application-Specific DOMs
    Trees
    DOM Parsers for Java
    Parsing Documents with a DOM Parser
    The Node Interface
    The NodeList Interface
    JAXP Serialization
    DOMException
    Choosing between SAX and DOM
    Summary
    Chapter 10. Creating XML Documents with DOM
    Chapter 11. The DOM Core
    Chapter 12. The DOM Traversal Module
    Chapter 13. Output from 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