Chapter 25

   

Java™ 2 Primer Plus
By Steven Haines, Steve Potts

Table of Contents
Appendix C.  Answers to Review Questions


A1:

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.

A2:

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

A3:

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

A4:

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.

A5:

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

A6:

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

A7:

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

A8:

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.

A9:

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

A10:

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).


       
    Top
     



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

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net