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.

Tip

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 properties—or, at worst, recognize them and throw a SAXNotSupportedException.

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.

External General Entity Processing

This feature tells a parser whether or not to process external general entities, such as:

 <!ENTITY copyright    SYSTEM "legal/copyright.xml">
URI: http://xml.org/sax/features/external-general-entities
Access: read/write
Default: unspecified; always true if the parser is validating (see the “Validation” section)

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 ...

Get Java and XML, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.