# XMLReaderAdapter

public class **XMLReaderAdapter** extends [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)  
implements [Parser](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html) [ContentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html) Adapt a SAX2 XMLReader as a SAX1 Parser.

> *This module, both source code and documentation, is in the
> Public Domain, and comes with **NO WARRANTY**.* See <http://www.saxproject.org> for further information.

This class wraps a SAX2 `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/XMLReader.html`
and makes it act as a SAX1 `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html`. The XMLReader
must support a true value for the
http://xml.org/sax/features/namespace-prefixes property or parsing will fail
with a `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html`; if the XMLReader
supports a false value for the http://xml.org/sax/features/namespaces
property, that will also be used to improve efficiency.

<br />

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html`
- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/XMLReader.html`

### Public Constructor Summary

|---|---|
|   | [XMLReaderAdapter](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#XMLReaderAdapter())() Create a new adapter. |
|   | [XMLReaderAdapter](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#XMLReaderAdapter(org.xml.sax.XMLReader))([XMLReader](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/XMLReader.html) xmlReader) Create a new adapter. |

### Public Method Summary

|---|---|
| void | [characters](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#characters(char[],%20int,%20int))(char\[\] ch, int start, int length) Adapt a SAX2 characters event. |
| void | [endDocument](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#endDocument())() End document event. |
| void | [endElement](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#endElement(java.lang.String,%20java.lang.String,%20java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) uri, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) localName, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) qName) Adapt a SAX2 end element event. |
| void | [endPrefixMapping](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#endPrefixMapping(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) prefix) Adapt a SAX2 end prefix mapping event. |
| void | [ignorableWhitespace](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#ignorableWhitespace(char[],%20int,%20int))(char\[\] ch, int start, int length) Adapt a SAX2 ignorable whitespace event. |
| void | [parse](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#parse(org.xml.sax.InputSource))([InputSource](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html) input) Parse the document. |
| void | [parse](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#parse(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) systemId) Parse the document. |
| void | [processingInstruction](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#processingInstruction(java.lang.String,%20java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) target, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) data) Adapt a SAX2 processing instruction event. |
| void | [setDTDHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#setDTDHandler(org.xml.sax.DTDHandler))([DTDHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/DTDHandler.html) handler) Register the DTD event handler. |
| void | [setDocumentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#setDocumentHandler(org.xml.sax.DocumentHandler))([DocumentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/DocumentHandler.html) handler) Register the SAX1 document event handler. |
| void | [setDocumentLocator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#setDocumentLocator(org.xml.sax.Locator))([Locator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html) locator) Set a document locator. |
| void | [setEntityResolver](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#setEntityResolver(org.xml.sax.EntityResolver))([EntityResolver](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/EntityResolver.html) resolver) Register the entity resolver. |
| void | [setErrorHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#setErrorHandler(org.xml.sax.ErrorHandler))([ErrorHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html) handler) Register the error event handler. |
| void | [setLocale](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#setLocale(java.util.Locale))([Locale](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Locale.html) locale) Set the locale for error reporting. |
| void | [skippedEntity](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#skippedEntity(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Adapt a SAX2 skipped entity event. |
| void | [startDocument](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#startDocument())() Start document event. |
| void | [startElement](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) uri, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) localName, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) qName, [Attributes](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Attributes.html) atts) Adapt a SAX2 start element event. |
| void | [startPrefixMapping](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#startPrefixMapping(java.lang.String,%20java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) prefix, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) uri) Adapt a SAX2 start prefix mapping event. |

### Inherited Method Summary

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

From interface [org.xml.sax.Parser](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html)

|---|---|
| abstract void | [parse](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#parse(org.xml.sax.InputSource))([InputSource](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html) source) Parse an XML document. |
| abstract void | [parse](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#parse(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) systemId) Parse an XML document from a system identifier (URI). |
| abstract void | [setDTDHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#setDTDHandler(org.xml.sax.DTDHandler))([DTDHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/DTDHandler.html) handler) Allow an application to register a DTD event handler. |
| abstract void | [setDocumentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#setDocumentHandler(org.xml.sax.DocumentHandler))([DocumentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/DocumentHandler.html) handler) Allow an application to register a document event handler. |
| abstract void | [setEntityResolver](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#setEntityResolver(org.xml.sax.EntityResolver))([EntityResolver](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/EntityResolver.html) resolver) Allow an application to register a custom entity resolver. |
| abstract void | [setErrorHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#setErrorHandler(org.xml.sax.ErrorHandler))([ErrorHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html) handler) Allow an application to register an error event handler. |
| abstract void | [setLocale](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#setLocale(java.util.Locale))([Locale](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Locale.html) locale) Allow an application to request a locale for errors and warnings. |

From interface [org.xml.sax.ContentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html)

|---|---|
| abstract void | [characters](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#characters(char[],%20int,%20int))(char\[\] ch, int start, int length) Receive notification of character data. |
| abstract void | [endDocument](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endDocument())() Receive notification of the end of a document. |
| abstract void | [endElement](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endElement(java.lang.String,%20java.lang.String,%20java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) uri, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) localName, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) qName) Receive notification of the end of an element. |
| abstract void | [endPrefixMapping](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endPrefixMapping(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) prefix) End the scope of a prefix-URI mapping. |
| abstract void | [ignorableWhitespace](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#ignorableWhitespace(char[],%20int,%20int))(char\[\] ch, int start, int length) Receive notification of ignorable whitespace in element content. |
| abstract void | [processingInstruction](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#processingInstruction(java.lang.String,%20java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) target, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) data) Receive notification of a processing instruction. |
| abstract void | [setDocumentLocator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#setDocumentLocator(org.xml.sax.Locator))([Locator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html) locator) Receive an object for locating the origin of SAX document events. |
| abstract void | [skippedEntity](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#skippedEntity(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name) Receive notification of a skipped entity. |
| abstract void | [startDocument](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startDocument())() Receive notification of the beginning of a document. |
| abstract void | [startElement](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startElement(java.lang.String,%20java.lang.String,%20java.lang.String,%20org.xml.sax.Attributes))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) uri, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) localName, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) qName, [Attributes](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Attributes.html) atts) Receive notification of the beginning of an element. |
| abstract void | [startPrefixMapping](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startPrefixMapping(java.lang.String,%20java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) prefix, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) uri) Begin the scope of a prefix-URI Namespace mapping. |

## Public Constructors

#### public
**XMLReaderAdapter**
()

Create a new adapter.

Use the "org.xml.sax.driver" property to locate the SAX2
driver to embed.

<br />

##### Throws

| [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | If the embedded driver cannot be instantiated or if the org.xml.sax.driver property is not specified. |
|---|---|

#### public
**XMLReaderAdapter**
([XMLReader](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/XMLReader.html) xmlReader)

Create a new adapter.

Create a new adapter, wrapped around a SAX2 XMLReader.
The adapter will make the XMLReader act like a SAX1
Parser.

<br />

##### Parameters

| xmlReader | The SAX2 XMLReader to wrap. |
|---|---|

##### Throws

| [NullPointerException](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/NullPointerException.html) | If the argument is null. |
|---|---|

## Public Methods

#### public void
**characters**
(char\[\] ch, int start, int length)

Adapt a SAX2 characters event.

##### Parameters

| ch | An array of characters. |
| start | The starting position in the array. |
| length | The number of characters to use. |
|---|---|

##### Throws

| [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | The client may raise a processing exception. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#characters(char[],%20int,%20int)`

#### public void
**endDocument**
()

End document event.

##### Throws

| [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | The client may raise a processing exception. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endDocument()`

#### public void
**endElement**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) uri, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) localName, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) qName)

Adapt a SAX2 end element event.

##### Parameters

| uri | The Namespace URI. |
| localName | The Namespace local name. |
| qName | The qualified (prefixed) name. |
|---|---|

##### Throws

| [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | The client may raise a processing exception. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endElement(java.lang.String,%20java.lang.String,%20java.lang.String)`

#### public void
**endPrefixMapping**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) prefix)

Adapt a SAX2 end prefix mapping event.

##### Parameters

| prefix | The prefix being mapped. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endPrefixMapping(java.lang.String)`

#### public void
**ignorableWhitespace**
(char\[\] ch, int start, int length)

Adapt a SAX2 ignorable whitespace event.

##### Parameters

| ch | An array of characters. |
| start | The starting position in the array. |
| length | The number of characters to use. |
|---|---|

##### Throws

| [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | The client may raise a processing exception. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#ignorableWhitespace(char[],%20int,%20int)`

#### public void
**parse**
([InputSource](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/InputSource.html) input)

Parse the document.

This method will throw an exception if the embedded
XMLReader does not support the
http://xml.org/sax/features/namespace-prefixes property.

<br />

##### Parameters

| input | An input source for the document. |
|---|---|

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | If there is a problem reading the raw content of the document. |
| [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | If there is a problem processing the document. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#parse(java.lang.String)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#parse(org.xml.sax.InputSource)`

#### public void
**parse**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) systemId)

Parse the document.

This method will throw an exception if the embedded
XMLReader does not support the
http://xml.org/sax/features/namespace-prefixes property.

<br />

##### Parameters

| systemId | The absolute URL of the document. |
|---|---|

##### Throws

| [IOException](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/IOException.html) | If there is a problem reading the raw content of the document. |
| [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | If there is a problem processing the document. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/helpers/XMLReaderAdapter.html#parse(org.xml.sax.InputSource)`
- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#parse(java.lang.String)`

#### public void
**processingInstruction**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) target, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) data)

Adapt a SAX2 processing instruction event.

##### Parameters

| target | The processing instruction target. |
| data | The remainder of the processing instruction |
|---|---|

##### Throws

| [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | The client may raise a processing exception. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#processingInstruction(java.lang.String,%20java.lang.String)`

#### public void
**setDTDHandler**
([DTDHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/DTDHandler.html) handler)

Register the DTD event handler.

##### Parameters

| handler | The new DTD event handler. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#setDTDHandler(org.xml.sax.DTDHandler)`

#### public void
**setDocumentHandler**
([DocumentHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/DocumentHandler.html) handler)

Register the SAX1 document event handler.

Note that the SAX1 document handler has no Namespace
support.

<br />

##### Parameters

| handler | The new SAX1 document event handler. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#setDocumentHandler(org.xml.sax.DocumentHandler)`

#### public void
**setDocumentLocator**
([Locator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html) locator)

Set a document locator.

##### Parameters

| locator | The document locator. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#setDocumentLocator(org.xml.sax.Locator)`

#### public void
**setEntityResolver**
([EntityResolver](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/EntityResolver.html) resolver)

Register the entity resolver.

##### Parameters

| resolver | The new resolver. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#setEntityResolver(org.xml.sax.EntityResolver)`

#### public void
**setErrorHandler**
([ErrorHandler](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html) handler)

Register the error event handler.

##### Parameters

| handler | The new error event handler. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#setErrorHandler(org.xml.sax.ErrorHandler)`

#### public void
**setLocale**
([Locale](https://developers.google.com/j2objc/javadoc/jre/reference/java/util/Locale.html) locale)

Set the locale for error reporting.

This is not supported in SAX2, and will always throw
an exception.

<br />

##### Parameters

| locale | the locale for error reporting. |
|---|---|

##### Throws

| [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | Thrown unless overridden. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Parser.html#setLocale(java.util.Locale)`

#### public void
**skippedEntity**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) name)

Adapt a SAX2 skipped entity event.

##### Parameters

| name | The name of the skipped entity. |
|---|---|

##### Throws

| [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | Throwable by subclasses. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#skippedEntity(java.lang.String)`

#### public void
**startDocument**
()

Start document event.

##### Throws

| [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | The client may raise a processing exception. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startDocument()`

#### public void
**startElement**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) uri, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) localName, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) qName, [Attributes](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Attributes.html) atts)

Adapt a SAX2 start element event.

##### Parameters

| uri | The Namespace URI. |
| localName | The Namespace local name. |
| qName | The qualified (prefixed) name. |
| atts | The SAX2 attributes. |
|---|---|

##### Throws

| [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html) | The client may raise a processing exception. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#endDocument()`

#### public void
**startPrefixMapping**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) prefix, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) uri)

Adapt a SAX2 start prefix mapping event.

##### Parameters

| prefix | The prefix being mapped. |
| uri | The Namespace URI being mapped to. |
|---|---|

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html#startPrefixMapping(java.lang.String,%20java.lang.String)`