home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeJava and XML, 2nd EditionSearch this book

A.3. JAXP 1.1

JAXP provides an abstraction layer over the process of getting a vendor's implementation of a SAX or DOM parser, as well as providing transformations in a vendor-neutral way.

A.3.1. Package: javax.xml.parsers

This is the single package used in JAXP, and details the classes needed for the JAXP abstraction and pluggability layer over XML parsing.

A.3.1.5. SAXParser

This class is the wrapper over an underlying SAX 1.0/2.0 parser implementation class, and allows parsing to occur in a vendor-neutral way. It essentially has a pair of each method: one for SAX 1.0, and one for SAX 2.0.

public abstract class SAXParser {
    public void parse(InputStream stream, HandlerBase base)
        throws SAXException, IOException, IllegalArgumentException;
    public void parse(InputStream stream, HandlerBase base, String systemID)
        throws SAXException, IOException, IllegalArgumentException;
    public void parse(String uri, HandlerBase base)
        throws SAXException, IOException, IllegalArgumentException;
    public void parse(File file, HandlerBase base)
        throws SAXException, IOException, IllegalArgumentException;
    public void parse(InputSource source, HandlerBase base)
        throws SAXException, IOException, IllegalArgumentException;

    public void parse(InputStream stream, DefaultHandler dh)
        throws SAXException, IOException, IllegalArgumentException;
    public void parse(InputStream stream, DefaultHandler dh, String systemID)
        throws SAXException, IOException, IllegalArgumentException;
    public void parse(String uri, DefaultHandler dh)
        throws SAXException, IOException, IllegalArgumentException;
    public void parse(File file, DefaultHandler dh)
        throws SAXException, IOException, IllegalArgumentException;
    public void parse(InputSource source, DefaultHandler dh)
        throws SAXException, IOException, IllegalArgumentException;

    public Parser getParser( ) throws SAXException;
    public XMLReader getXMLReader( ) throws SAXException;

    public Object getProperty(String name);
    public void setProperty(String name, Object value);
    public boolean isNamespaceAware( );
    public boolean isValidating( );
}

A.3.2. Package: javax.xml.transform

This is the package used in JAXP for transforming XML documents. It allows these transformations to be pluggable and vendor-neutral, provided they use the TrAX (Transformations API for XML) interfaces defined here.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.