Features and Properties

SAX parsers, that is, XMLReader objects, are configured by setting features and properties. A feature has a boolean true/false value. A property has an object value. Both features and properties are named by absolute URIs. This allows just a handful of standard methods to support an arbitrary number of standard and nonstandard features and properties of various types.

Features and properties can be read-only, write-only (rare), or read-write. If you attempt to change a read-only feature or property, then a SAXNotSupportedException, a subclass of SAXException, is thrown. The accessibility of a feature or property can change depending on whether or not the XMLReader is currently parsing a document. For example, you can turn ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.