4.1 How to Use the SAX2 Features and Properties

The SAX2 standards define how to use the SAX parser's optional functions by using features and properties.

A feature or property name is a URI corresponding to an optional function of the SAX parser. The formats of the feature and property names are as follows:

[Figure]

Table 4-1 and Table 4-2 list the SAX2 features and SAX2 properties supported by Cosminexus XML Processor respectively.

Table 4-1 SAX2 features supported by Cosminexus XML Processor

No.Feature name
1http://xml.org/sax/features/external-general-entitie
2http://xml.org/sax/features/external-parameter-entities
3http://xml.org/sax/features/namespaces
4http://xml.org/sax/features/namespace-prefixes
5http://xml.org/sax/features/use-attributes2
6http://xml.org/sax/features/use-locator2
7http://xml.org/sax/features/use-entity-resolver2
8http://xml.org/sax/features/validation

Table 4-2 SAX2 properties supported by Cosminexus XML Processor

No.Property name
1http://xml.org/sax/properties/declaration-handler
2http://xml.org/sax/properties/lexical-handler

For the meaning of each feature and property, see the following parts in Javadoc of Simple API for XML (SAX) 2.0.2 (sax2r3):

Organization of this section
(1) How to use the SAX2 features
(2) How to use the SAX2 properties

(1) How to use the SAX2 features

To set a SAX2 feature, use the setFeature method of the org.sax.xml.XMLReader class. How to set a feature is shown below:

[Figure]

(2) How to use the SAX2 properties

To set a SAX2 property, use the setProperty method of the org.sax.xml.XMLReader class. How to set a property is shown below.

[Figure]