XMLReader

Interface for reading an XML document using callbacks.

<p>XMLReader is the interface that an XML parser's SAX2 driver must implement. This interface allows an application to set and query features and properties in the parser, to register event handlers for document processing, and to initiate a document parse.</p>

<p>All SAX interfaces are assumed to be synchronous: the {@link #parse parse} methods must not return until parsing is complete, and readers must wait for an event-handler callback to return before reporting the next event.</p>

<p>This interface replaces the (now deprecated) SAX 1.0 {@link org.xml.sax.Parser Parser} interface. The XMLReader interface contains two important enhancements over the old Parser interface (as well as some minor ones):</p>

<ol> <li>it adds a standard way to query and set features and properties; and</li> <li>it adds Namespace support, which is required for many higher-level XML standards.</li> </ol>

<p>There are adapters available to convert a SAX1 Parser to a SAX2 XMLReader and vice-versa.</p>

@since SAX 2.0 @author David Megginson @version 2.0.1+ (sax2r3pre1) @see org.xml.sax.XMLFilter @see org.xml.sax.helpers.ParserAdapter @see org.xml.sax.helpers.XMLReaderAdapter

Members

Functions

getEntityResolver
EntityResolver!(Ch) getEntityResolver()

Return the current entity resolver.

getErrorHandler
ErrorHandler!(Ch) getErrorHandler()

Return the current error handler.

getFeature
bool getFeature(const(Ch)[] name)

Look up the value of a feature flag.

getProperty
Object getProperty(const(Ch)[] name)

Look up the value of a property.

getSaxHandler
SaxHandler!(Ch) getSaxHandler()

Return the current content handler.

parse
void parse(const(Ch)[] content)

Parse an XML document from a character array.

parse
void parse()
setContent
void setContent(const(Ch)[] content)
setEntityResolver
void setEntityResolver(EntityResolver!(Ch) resolver)

Allow an application to register an entity resolver.

setErrorHandler
void setErrorHandler(ErrorHandler!(Ch) handler)

Allow an application to register an error event handler.

setFeature
void setFeature(const(Ch)[] name, bool value)

Set the value of a feature flag.

setProperty
void setProperty(const(Ch)[] name, Object value)

Set the value of a property.

setSaxHandler
void setSaxHandler(SaxHandler!(Ch) handler)

Allow an application to register a content event handler.

Meta