Summary

The SAX XMLReader interface represents an XML parser. The actual implementation class will vary from one parser to the next, but generally you'll only interact with it through the parser-independent methods in XMLReader. Parser-specific instances of this interface are built by the XMLReaderFactory factory class.

The XMLReader's parse() method actually reads the XML document. One parser object can read multiple documents in series. However, parsers are neither thread safe nor reentrant and should not be used to read documents in parallel. The source from which the XML document is read—be it an InputStream, Reader, or URI—is wrapped inside an org.xml.sax.InputSource object. You can use an EntityResolver to replace one InputSource with a ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.