
XML and Java • 341
1. Create an instance of the appropriate JAXP factory (SAX, DOM, or StAX).
2. The factory will refer to some properties file to know which implementation (for
example, Apache Xerces) of the JAXP parser to invoke.
3. Get an instance of the implemented parser (SAX, DOM, or StAX as implemented by
Apache Xerces or another implementation, as defined in the properties file above).
Figure 7.15 Initial steps in using JAXP
Now it should be clear how JAXP makes our application program independent of the parser
implementation. In other words, our application program talks to the abstraction layer of JAXP, and in our
properties file we ...