4.6 How to use the properties of the high-speed parse support function
To use the high-speed parse support function, you need to set the following property defined independently by Cosminexus XML Processor.
Set up either null or PreparsedObject object in the property value. The following table lists the property values to set and their meanings.
Value set in the property# |
Meaning |
---|---|
null |
The preparsed object is not used when parsing. |
PreparsedObject object |
The specified preparsed object is used when parsing. |
- #
-
If no value is specified, it is assumed to be null.
If a value other than null and the PreparsedObject object is set up, the following exceptions occur depending on the XML parser in which the property is set up:
-
In DocumentBuilderFactory: IllegalArgumentException
-
In SAXParser or XMLReader: SAXNotSupportedException
-
The properties of the high-speed parse support function must be set up in each object of the following XML parsers. The following table describes how to set up the preparsed object. This table lists the methods to use for setting the properties for each class and interface.
Class and interface |
Method |
---|---|
javax.xml.parsers.DocumentBuilderFactory |
setAttribute |
javax.xml.parsers.SAXParser |
setProperty |
org.xml.sax.XMLReader |
setProperty |
The details for using the high-speed parse support function in DocumentBuilder, SAXParser, and XMLReader are described in the following subsections with appropriate examples.