public class SAXParser extends Object implements XMLReader, Parser:
Pure Klyn non-validating SAX parser.
The parser implements the SAX2 XMLReader API and the deprecated SAX1 Parser API. It reports document, element, Namespace, character, processing instruction, CDATA, comment and DTD lexical events without using native code.
This implementation focuses on well-formed XML parsing. It does not validate documents and does not read external entities by default.
@example `klyn import klyn.io.xml.sax import org.xml.sax
parser = SAXParser() parser.setContentHandler(DefaultHandler()) parser.parse(InputSource("file:/tmp/doc.xml"))
| Modifier and Type | Member | Description |
|---|---|---|
| public | SAXParserSAXParser(): |
Creates a non-validating SAX parser. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | getContentHandlergetContentHandler() as ContentHandler: |
Returns the SAX2 content handler. |
| public | getDTDHandlergetDTDHandler() as DTDHandler: |
Returns the DTD handler. |
| public | getEntityResolvergetEntityResolver() as EntityResolver: |
Returns the entity resolver. |
| public | getErrorHandlergetErrorHandler() as ErrorHandler: |
Returns the error handler. |
| public | getFeaturegetFeature(name as String) as Boolean throws SAXNotRecognizedException, SAXNotSupportedException: |
Returns the current feature value. |
| public | getPropertygetProperty(name as String) as Object throws SAXNotRecognizedException, SAXNotSupportedException: |
Returns a SAX property value. |
| public | parseparse(input as InputSource) as Void throws IOException, SAXException: |
Parses XML from an input source. |
| public | parseparse(input as InputSource, handler as ContentHandler) as Void throws IOException, SAXException: |
Parses an input source with a content handler. |
| public | parseparse(input as InputSource, handler as DefaultHandler) as Void throws IOException, SAXException: |
Parses an input source with a `DefaultHandler`. |
| public | parseparse(systemId as String) as Void throws IOException, SAXException: |
Parses XML from a system identifier. |
| public | parseparse(systemId as String, handler as ContentHandler) as Void throws IOException, SAXException: |
Parses a system identifier with a content handler. |
| public | parseparse(systemId as String, handler as DefaultHandler) as Void throws IOException, SAXException: |
Parses a system identifier with a `DefaultHandler`. |
| public | setContentHandlersetContentHandler(handler as ContentHandler) as Void: |
Registers the SAX2 content handler. |
| public | setDTDHandlersetDTDHandler(handler as DTDHandler) as Void: |
Registers the DTD handler. |
| public | setDocumentHandlersetDocumentHandler(handler as DocumentHandler) as Void: |
Registers the SAX1 document handler. |
| public | setEntityResolversetEntityResolver(resolver as EntityResolver) as Void: |
Registers the entity resolver. |
| public | setErrorHandlersetErrorHandler(handler as ErrorHandler) as Void: |
Registers the error handler. |
| public | setFeaturesetFeature(name as String, value as Boolean) as Void throws SAXNotRecognizedException, SAXNotSupportedException: |
Sets a feature value. |
| public | setLocalesetLocale(locale as Locale) as Void throws SAXException: |
Accepts a preferred diagnostics locale. |
| public | setPropertysetProperty(name as String, value as Object) as Void throws SAXNotRecognizedException, SAXNotSupportedException: |
Sets a SAX property value. |