JAXP Lookup MechanismJAXP 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.
 where uri is the parameter to the
jaxp.propertiesis a configuration file in standard
Propertiesformat and typically located in the
confdirectory 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.
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.propertiesis a configuration file that functions the same as
jaxp.propertiesexcept that it is only used by StAX factory lookup.
Lookup ProcedureThe JAXP Factories follow the procedure described below in order to locate and load the implementation class:
- Use the system property as described in column System Property of the table JAXP Factories above.
Use the service-provider loading facility, defined by the
ServiceLoaderclass, to attempt to locate and load an implementation of the service using the default loading mechanism: the service-provider loading facility will use the current thread's context class loader to attempt to load the service. If the context class loader is null, the system class loader will be used.
SchemaFactory, each potential service provider is required to implement the method
isSchemaLanguageSupported(String schemaLanguage). The first service provider found that supports the specified schema language is returned.
XPathFactory, each potential service provider is required to implement the method
isObjectModelSupported(String objectModel). The first service provider found that supports the specified object model is returned.
system-defaultimplementation is returned, which is equivalent to calling the
newDefaultInstance() or newDefaultFactory()method as shown in column System Default of the table JAXP Factories above.
SchemaFactory, there must be a platform default
SchemaFactoryfor W3C XML Schema.
XPathFactory, there must be a platform default
XPathFactoryfor the W3C DOM, i.e.
- Implementation Note:
Implementation Specific Features and PropertiesIn addition to the standard features and properties described within the public APIs of this module, the JDK implementation supports a further number of implementation specific features and properties. This section describes the naming convention, System Properties, jaxp.properties, scope and order, and processors to which a property applies. A table listing the implementation specific features and properties which the implementation currently supports can be found at the end of this note.
Naming ConventionThe names of the features and properties are fully qualified, composed of a prefix and name.
PrefixThe prefix for JDK properties is defined as:
NameA name may consist of one or multiple words that are case-sensitive. All letters of the first word are in lowercase, while the first letter of each subsequent word is capitalized.
An example of a property that indicates whether an XML document is standalone would thus have a format:
System PropertiesA property may have a corresponding System Property that has the same name except for the prefix as shown above. A System Property should be set prior to the creation of a processor and may be cleared afterwards.
jaxp.propertiesA system property can be specified in the jaxp.properties file to set the behavior for all invocations of the JDK. The format is
system-property-name=value. For example:
Scope and OrderThe
XMLConstants.FEATURE_SECURE_PROCESSINGfeature (hereafter referred to as secure processing) is required for XML processors including DOM, SAX, Schema Validation, XSLT, and XPath. Any properties flagged as
"security: yes"(hereafter referred to as security properties) in table Implementation Specific Properties are enforced when secure processing is set to true. Such enforcement includes setting security features to true and limits to the defined values shown in the table. The property values will not be affected, however, when setting secure processing to false.
When the Java Security Manager is present, secure processing is set to true and can not be turned off. The security properties are therefore enforced.
Properties specified in the jaxp.properties file affect all invocations of the JDK, and will override their default values, or those that may have been set by secure processing.
System properties, when set, affect the invocation of the JDK and override the default settings or those that may have been set in jaxp.properties or by secure processing.
JAXP properties specified through JAXP factories or processors (e.g. SAXParser) take preference over system properties, the jaxp.properties file, as well as secure processing.
Processor SupportFeatures and properties may be supported by one or more processors. The following table lists the processors by IDs that can be used for reference.
Processors ID Name How to set the property DOM DOM Parser
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
SAX SAX Parser
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser parser = spf.newSAXParser();
StAX StAX Parser
XMLInputFactory xif = XMLInputFactory.newInstance();
Validation XML Validation API
SchemaFactory schemaFactory = SchemaFactory.newInstance(schemaLanguage);
Transform XML Transform API
TransformerFactory factory = TransformerFactory.newInstance();
XSLTC Serializer XSLTC Serializer
Transformer transformer = TransformerFactory.newInstance().newTransformer();
DOMLS DOM Load and Save
LSSerializer serializer = domImplementation.createLSSerializer();
Implementation Specific Features and PropertiesThe Implementation Specific Features and Properties reflect JDK's choice to manage the limitations on resources while complying with the API specification, or allow applications to alter behaviors beyond those required by the standards.
The table below lists the Implementation Specific Properties currently supported by the JDK. More properties may be added in the future if necessary.
Implementation Specific Properties Name  Description System Property  jaxp.properties  Value  Security  Supported Processor  Since  Type Value Default entityExpansionLimit Limits the number of entity expansions. yes yes Integer A positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumberFormatException is thrown. 64000 Yes DOM
8 elementAttributeLimit Limits the number of attributes an element can have. 10000 maxOccurLimit Limits the number of content model nodes that may be created when building a grammar for a W3C XML Schema that contains maxOccurs attributes with values other than "unbounded". 5000 totalEntitySizeLimit Limits the total size of all entities that include general and parameter entities. The size is calculated as an aggregation of all entities. 5x10^7 maxGeneralEntitySizeLimit Limits the maximum size of any general entities. 0 maxParameterEntitySizeLimit Limits the maximum size of any parameter entities, including the result of nesting multiple parameter entities. 10^6 entityReplacementLimit Limits the total number of nodes in all entity references. 3x10^6 maxElementDepth Limits the maximum element depth. 0 maxXMLNameLimit Limits the maximum size of XML names, including element name, attribute name and namespace prefix and URI. 1000 isStandalone indicates that the serializer should treat the output as a standalone document. The property can be used to ensure a newline is written after the XML declaration. Unlike the property
xml-declaration, this property does not have an effect on whether an XML declaration should be written out.
yes yes boolean true/false false No DOMLS 17 xsltcIsStandalone indicates that the XSLTC serializer should treat the output as a standalone document. The property can be used to ensure a newline is written after the XML declaration. Unlike the property
OMIT_XML_DECLARATION, this property does not have an effect on whether an XML declaration should be written out.
yes yes String yes/no no No XSLTC Serializer 17
 The name of a property. The fully-qualified name, prefix + name, should be used when setting the property.
 A value "yes" indicates there is a corresponding System Property for the property, "no" otherwise.
 The value must be exactly as listed in this table, case-sensitive. The value of the corresponding System Property is the String representation of the property value. If the type is boolean, the system property is true only if it is "true"; If the type is String, the system property is true only if it is exactly the same string representing the positive value (e.g. "yes" for
xsltcIsStandalone); The system property is false otherwise. If the type is Integer, the value of the System Property is the String representation of the value (e.g. "64000" for
 A value "yes" indicates the property is a Security Property. Refer to the Scope and Order on how secure processing may affect the value of a Security Property.
 One or more processors that support the property. The values of the field are IDs described in table Processors.
 Indicates the initial release the property is introduced.
- Module Graph:
PackagesPackageDescriptionDefines constants for XML processing.Provides the classes for implementing XML Catalogs OASIS Standard V1.1, 7 October 2005.Defines XML/Java Type Mappings.Defines XML Namespace processing.Provides the classes for processing XML documents with a SAX (Simple API for XML) parser or a DOM (Document Object Model) Document builder.Defines interfaces and classes for the Streaming API for XML (StAX).Defines event interfaces for the Streaming API for XML (StAX).Provides utility classes for the Streaming API for XML (StAX).Defines the generic APIs for processing transformation instructions, and performing a transformation from source to result.Provides DOM specific transformation classes.Provides SAX specific transformation classes.Provides StAX specific transformation classes.Provides stream and URI specific transformation classes.Provides an API for validation of XML documents.Provides an object-model neutral API for the evaluation of XPath expressions and access to the evaluation environment.Provides the interfaces for the Document Object Model (DOM).Provides a factory for obtaining instances of
DOMImplementation.Provides interfaces for DOM Level 2 Events.Provides interfaces for DOM Level 3 Load and Save.Provides interfaces for DOM Level 2 Range.Provides interfaces for DOM Level 2 Traversal.Provides interfaces for DOM Level 2 Views.Provides the interfaces for the Simple API for XML (SAX).Provides interfaces to SAX2 facilities that conformant SAX drivers won't necessarily support.Provides helper classes, including support for bootstrapping SAX-based applications.
ServicesTypeDescriptionFactory that creates new
Objects that map XML to/from Java
Objects.Defines a factory API that enables applications to obtain a parser that produces DOM object trees from XML documents.Defines a factory API that enables applications to configure and obtain a SAX based parser to parse XML documents.Factory that creates
Schemaobjects.This interface defines a utility class for creating instances of XMLEventsDefines an abstract implementation of a factory for getting streams.Defines an abstract implementation of a factory for getting XMLEventWriters and XMLStreamWriters.Interface for reading an XML document using callbacks.An
XPathFactoryinstance can be used to create