Module java.xml


module java.xml
Defines the Java API for XML Processing (JAXP), the Streaming API for XML (StAX), the Simple API for XML (SAX), and the W3C Document Object Model (DOM) API.

JAXP Lookup Mechanism

JAXP defines an ordered lookup procedure to determine the implementation class to load for the JAXP factories. Factories that support the mechanism are listed in the table below along with the method, System Property name, Configuration File, and System Default method to be used in the procedure.
JAXP Factories
Factory Method System Property Name Configuration File System Default
DatatypeFactory newInstance() javax.xml.datatype.DatatypeFactory jaxp.properties newDefaultInstance()
DocumentBuilderFactory newInstance() javax.xml.parsers.DocumentBuilderFactory jaxp.properties newDefaultInstance()
SAXParserFactory newInstance() javax.xml.parsers.SAXParserFactory jaxp.properties newDefaultInstance()
XMLEventFactory newFactory() javax.xml.stream.XMLEventFactory stax.properties and then jaxp.properties newDefaultFactory()
XMLInputFactory newFactory() javax.xml.stream.XMLInputFactory stax.properties and then jaxp.properties newDefaultFactory()
XMLOutputFactory newFactory() javax.xml.stream.XMLOutputFactory stax.properties and then jaxp.properties newDefaultFactory()
TransformerFactory newInstance() javax.xml.transform.TransformerFactory jaxp.properties newDefaultInstance()
SchemaFactory newInstance(schemaLanguage) javax.xml.validation.SchemaFactory:schemaLanguage[1] jaxp.properties newDefaultInstance()
XPathFactory newInstance(uri) DEFAULT_PROPERTY_NAME + ":uri"[2] jaxp.properties newDefaultInstance()
[1] where schemaLanguage is the parameter to the newInstance(schemaLanguage) method.

[2] where uri is the parameter to the newInstance(uri) method.

jaxp.properties

jaxp.properties is a configuration file in standard Properties format and typically located in the conf directory of the Java installation. It contains the fully qualified name of the implementation class with the key being the system property name defined in the table above.

The jaxp.properties file is read only once by the implementation and the values are then cached for future use. If the file does not exist when the first attempt is made to read from it, no further attempts are made to check for its existence. It is not possible to change the value of any property after it has been read for the first time.

stax.properties

stax.properties is a configuration file that functions the same as jaxp.properties except that it is only used by StAX factory lookup.

Lookup Procedure

The JAXP Factories follow the procedure described below in order to locate and load the implementation class:
Since:
9