All Packages Class Hierarchy This Package Previous Next Index
This interface is part of the Java implementation of SAX, the Simple API for XML. It is free for both commercial and non-commercial use, and is distributed with no warrantee, real or implied.
This is the main handler for basic document events; it provides information on roughly the same level as the ESIS in full SGML, concentrating on logical structure rather than lexical representation.
If you do not set a document handler, then by default all of these events will simply be ignored.
public abstract void startDocument() throws Exception
This is the first event called by a SAX-conformant parser, so you can use it to allocate and initialise new objects for the document.
public abstract void endDocument() throws Exception
This is the last event called by a SAX-conformant parser, so you can use it to finalize and clean up objects for the document.
public abstract void doctype(String name, String publicID, String systemID) throws Exception
This will appear only if the XML document contains a
DOCTYPE
declaration.
public abstract void startElement(String name, AttributeMap attributes) throws Exception
Please note that the information in the attributes
parameter will be accurate only for the duration of this handler:
if you need to use the information elsewhere, you should copy
it.
public abstract void endElement(String name) throws Exception
public abstract void characters(char ch[], int start, int length) throws Exception
Please note that the contents of the array will be accurate only for the duration of this handler: if you need to use them elsewhere, you should make your own copy, possible by constructing a string:
String data = new String(ch, start, length);
public abstract void ignorable(char ch[], int start, int length) throws Exception
Please note that the contents of the array will be accurate only for the duration of this handler: if you need to use them elsewhere, you should make your own copy, possible by constructing a string:
String whitespace = new String(ch, start, length);
public abstract void processingInstruction(String name, String remainder) throws Exception
XML processing instructions have two parts: a target, which is a name, followed optionally by data.
All Packages Class Hierarchy This Package Previous Next Index