Chapter 25


Java™ 2 Primer Plus
By Steven Haines, Steve Potts

Table of Contents
Appendix C.  Answers to Review Questions


XML is a good choice for transferring data between operating systems and programming languages because it is character-based and agnostic to the underlying operating system or programming language. Furthermore, its structure is very intuitive and can align itself very well with programming data structures.


SAX is an event-based parser and a DOM is a tree-based parser.


SAX parses data faster because it does not need to construct the in-memory tree that the DOM does.


The SAX parser streams through an XML file and notifies the calling process as it encounters tags and data, but does not maintain any part of the XML document in memory.


You would be forced to use SAX over DOM when the size of the XML document exceeds the memory limitations of your physical hardware.


XSLT is an engine that translates an XML document to another form based off of instructions contained in a stylesheet.


A stylesheet provides instructions to the XSLT processor about how to translate the source XML document to its final destination type.


JDOM is built on top of Java's collection classes; anyone familiar with using the Java collection classes will find reading an XML document through JDOM extremely simple.


You read an XML document using JDOM by creating a SAXParser and calling its build() method.


You can print a copy of the XML document to the screen by using the XMLOutputter class and passing it an XML document and the standard output stream (System.out).


    Java 2 Primer Plus
    Java 2 Primer Plus
    ISBN: 0672324156
    EAN: 2147483647
    Year: 2001
    Pages: 332

    Similar book on Amazon © 2008-2017.
    If you may any questions please contact us: