Index
[]accept( ) methodAdobe Flash [See Flash][See also Xerces]declarations
Index
[][See also JAXB]browsers
Index
[]callbacksCascading Style Sheets [See CSS]child nodesclassesclosing XML tagscommand-line schema compiler [See xjc application]commentsconstantsconstraining XMLcontent syndication [See RSS]cross-domain policy files (Flash) [See crossdomain.xml files]
Index
[][See JAXB]JAXBdatatypesdeclarationsdom4jDocument Object Model [See DOM]document object model for Java [See dom4j]
Index
[]declarationsENTITY_DECLARATION eventENTITY_REFERENCE eventerror handlingerrorsescaping characterseventsExtensible Stylesheet Language [See XSL]Extensible Stylesheet Transformations [See XSLT]externalEntityDecl( ) method
Index
[]factoriesdom4jfeaturesfiltersFirefoxXML objects written in dom4jfunctions
Index
[]getFeature( ) method
Index
[]handlersHTML
Index
[]IE [See Internet Explorer]input and outputinterfacesInternet Explorer (IE)
Appendix 1. SAX Features and Properties
This appendix describes the SAX 2.0 standard features and properties. Although a vendor's parsing software can add additional features and properties for vendor-specific functionality, this list represents the core set of functionality that any SAX 2.0-compliant parser implementation should support.
| To be precise, these are drawn from the SAX 2.0.2 release 3. However, any SAX 2.x parser should provide these features and propertiesor, at worst, recognize them and throw a SAXNotSupportedException . |
|
A.1. Core Features
The core set of features supported by SAX 2.0 XMLReader implementations is listed here. These features can be set through setFeature( ) , and the value of a feature can be obtained through getFeature( ) . Any feature can be read-only or read/write; features also may be modifiable only when parsing is occurring, or only when parsing is not occurring. For more information on SAX features and properties, refer to Chapter 4.
A.1.1. External General Entity Processing
This feature tells a parser whether or not to process external general entities, such as:
URI: http://xml.org/sax/features/external-general-entities Access: read/writeDefault: unspecified; always TRue if the parser is validating (see the "Validation" section)
A.1.2. External Parameter Entity Processing
This feature tells a parser whether or not to process external parameter entities, used to define DTDs by a system and/or public ID (rather than directly in an XML document by location):
URI: http://xml.org/sax/features/external-parameter-entities Access: read/writeDefault: unspecified; always true if the parser is validating (see the "Validation" section)
A.1.3. Standalone
This feature reports whether a document is standalone, declared via the standalone attribute in the XML declaration:
URI: http://xml.org/sax/features/is-standalone Access: read-only during parsing; not available otherwiseDefault: not applicable
| This feature is a bit of an aberration; it's available only during parsing, and must be called after the startDocument( ) callback has been fired. Additionally, you can't set this feature on a parser; it has no meaning outside of the parsing context. |
|
A.1.4. Parameter Entity Reporting
This features lets a parser know that " property section).
URI: http://xml.org/sax/features/lexical-handler/parameter-entities Access: read/writeDefault: unspecified
A.1.5. Namespace Processing
This feature instructs a parser to perform namespace processing, which causes namespace prefixes, namespace URIs, and element local names to be available through the SAX namespace callbacks ( startPrefixMapping( ) and endPrefixMapping( ) , as well as certain parameters supplied to startElement( ) and endElement( ) ). When this feature is true , the processing will occur. When false , namespace processing will not occur (this implies that "Namespace Prefix Reporting" is on).
URI: http://xml.org/sax/features/namespaces Access: read/writeDefault: true
A.1.6. Namespace Prefix Reporting
This feature instructs a parser to report the attributes used in namespace declarations, such as the xmlns:[namespace URI] attributes. When this feature is not on ( false ), namespace-related attributes are not reported, as the parser consumes them in order to discover a namespace prefix to URI mappings, and they are generally not of value to the wrapping application in that context. In addition, when namespace processing is turned on, generally namespace prefix mapping is turned off.
URI: http://xml.org/sax/features/namespace-prefixes Access: read-only when parsing, read/write when not parsingDefault: false
A.1.7. Absolute URI Declaration Resolution
If this feature is TRue , absolute paths are returned from the following methods (all on the DTDHandler interface, detailed in Chapter 4):
notationDecl( )
unparsedEntityDecl( )
externalEntityDecl( )
| This feature has no effect on resolveEntity( ) in EntityResolver , which isn't used to report declarations (entities are not the same as declarations). Additionally, startDTD( ) in LexicalHandler always returns a nonabsolute URI, and is unaffected. |
|
URI: http://xml.org/sax/features/resolve-dtd-uris Access: read/writeDefault: true
A.1.8. String Interning
This feature dictates that all element raw and local names, namespace prefixes, and namespace URIs are interned using java.lang.String.intern( ) . When not on ( false ), all XML components are left as is.
URI: http://xml.org/sax/features/string-interning Access: read-only when parsing, read/write when not parsingDefault: unspecified; newer, high-performance parsers usually have this set to false by default, so they can perform their own optimizations for dealing with character data
A.1.9. Unicode Normalization Checking
Related largely to XML 1.1, this feature indicates whether a parser should report Unicode normalization errors (defined in section 2.13 and Appendix B of the XML 1.1 specification). If set to true , these errors are made visible via the error( ) callback on ErrorHandler .
URI: http://xml.org/sax/features/validation Access: read-writeDefault: false
A.1.10. Attributes2 Usage
SAX 2 defines an "enhanced" version of several core SAX interfaces in org.xml.sax.ext ; the Attributes2 interface is one of those (it exposes extra constraint-related information, particularly about attributes). You can check to see if your parser is returning an implementation of this interfaceand not of the normal Attributes interfacewith this feature.
URI: http://xml.org/sax/features/use-attributes2 Access: read-onlyDefault: not applicable
A.1.11. Locator2 Usage
Like the Attributes2 interface (see the previoius section, "Attributes2 Usage"), Locator2 is an enhanced version of Locator . Located in the org.xml.sax.ext package, this interface provides information about entity character encoding (and in some cases, the XML version of parameter entities). You can check to see if your parser is returning an implementation of this interfaceand not of the normal Locator interfacewith this feature.