axproject.org'>http://www.saxproject.org for further information.
This is the main interface that most SAX applications implement: if the application needs to be informed of basic parsing events, it implements this interface and registers an instance with the SAX parser using the {@link org.xml.sax.XMLReader#setContentHandler setContentHandler} method. The parser uses the instance to report basic document-related events like the start and end of elements and character data.
The order of events in this interface is very important, and mirrors the order of information in the document itself. For example, all of an element's content (character data, processing instructions, and/or subelements) will appear, in order, between the startElement event and the corresponding endElement event.
This interface is similar to the now-deprecated SAX 1.0 DocumentHandler interface, but it adds support for Namespaces and for reporting skipped entities (in non-validating XML processors).
Implementors should note that there is also a ContentHandler
class in the java.net
package; that means that it's probably a bad idea to do
import java.net.*; import org.xml.sax.*;
In fact, "import ...*" is usually a sign of sloppy programming anyway, so the user should consider this a feature rather than a bug.
@since SAX 2.0
@author David Megginson
@version 2.0.1+ (sax2r3pre1)
@see org.xml.sax.XMLReader
@see org.xml.sax.DTDHandler
@see org.xml.sax.ErrorHandler