SaxHandler

Receive notification of the logical content of a document.

<p>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.</p>

<p>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.</p>

<p>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).</p>

<p>Implementors should note that there is also a <code>ContentHandler</code> class in the <code>java.net</code> package; that means that it's probably a bad idea to do</p>

<pre>import java.net.*; import org.xml.sax.*; </pre>

<p>In fact, "import ...*" is usually a sign of sloppy programming anyway, so the user should consider this a feature rather than a bug.</p>

@since SAX 2.0 @author David Megginson @version 2.0.1+ (sax2r3pre1) @see org.xml.sax.XMLReader @see org.xml.sax.ErrorHandler

Members

Functions

characters
void characters(const(Ch)[] ch)

Receive notification of character data.

endDocument
void endDocument()

Receive notification of the end of a document.

endElement
void endElement(const(Ch)[] uri, const(Ch)[] localName, const(Ch)[] qName)

Receive notification of the end of an element.

endPrefixMapping
void endPrefixMapping(const(Ch)[] prefix)

End the scope of a prefix-URI mapping.

ignorableWhitespace
void ignorableWhitespace(Ch[] ch)

Receive notification of ignorable whitespace in element content.

processingInstruction
void processingInstruction(const(Ch)[] target, const(Ch)[] data)

Receive notification of a processing instruction.

setDocumentLocator
void setDocumentLocator(Locator!(Ch) locator)

Receive an object for locating the origin of SAX document events.

skippedEntity
void skippedEntity(const(Ch)[] name)

Receive notification of a skipped entity. This is not called for entity references within markup constructs such as element start tags or markup declarations. (The XML recommendation requires reporting skipped external entities. SAX also reports internal entity expansion/non-expansion, except within markup constructs.)

startDocument
void startDocument()

Receive notification of the beginning of a document.

startElement
void startElement(const(Ch)[] uri, const(Ch)[] localName, const(Ch)[] qName, Attribute!(Ch)[] atts)

Receive notification of the beginning of an element.

startPrefixMapping
void startPrefixMapping(const(Ch)[] prefix, const(Ch)[] uri)

Begin the scope of a prefix-URI Namespace mapping.

Variables

locator
Locator!(Ch) locator;
Undocumented in source.

Meta