Properties provide a way to deal with objects used in the parsing process, particularly when dealing with handlers such as LexicalHandler and DeclHandler that are not in the core set of SAX 2.0 handlers (EntityResolver, DTDHandler, ContentHandler, and ErrorHandler). Any property can be read-only or read/write; features also may be modifiable only when parsing is occurring, or only when parsing is not occurring.

A.2.1. Declaration Handler

This property allows the setting and retrieval of a DeclHandler implementation to be used for handling of constraints within a DTD.

URI: http://xml.org/sax/properties/declaration-handler
Datatype: org.xml.sax.ext.DeclHandler
Access: read/write

A.2.2. Document Version

This property returns the version string of the XML document, indicated by the version attribute in the XML declaration:

<?xml version="1.0"?>
Java Warning Like "Standalone," this property acts a bit abnormally; it's only available during parsing, and must be called after the startDocument( ) callback has been fired.

URI: http://xml.org/sax/properties/document-xml-version
Datatype: String
Access: read-only during parsing; not available otherwise

A.2.3. DOM Node

When parsing is occurring, this property retrieves the current DOM node (if a DOM iterator is being used). When parsing is not occurring, it retrieves the root DOM node.

Java Warning Most of the parsers I used in testing for this tutorial did not support this property except in very special cases; you shouldn't rely on it providing useful information in the general case.

URI: http://xml.org/sax/properties/dom-node
Datatype: org.w3c.dom.Node
Access: read-only when parsing; read/write when not parsing

A.2.4. Lexical Handler

This property allows the setting and retrieval of a LexicalHandler implementation to be used for handling of comments and DTD references within an XML document.

URI: http://xml.org/sax/properties/lexical-handler
Datatype: org.xml.sax.ext.LexicalHandler
Access: read/write

A.2.5. Literal (XML) String

This retrieves the literal characters in the XML document that triggered the event in the process when this property is used.

Java Warning Like the DOM node feature, I found little use and little support for this property. Don't depend on it, particularly across parsers.

URI: http://xml.org/sax/properties/xml-string
Datatype: java.lang.String
Access: read-only when parsing; not applicable outside of parsing