Processing Limit Definitions

The following list describes the JAXP XML Processing Limits supported in the JDK. These limits can be specified through the factory APIs, system properties, and the jaxp\.properties file.

entityExpansionLimit

AttributeDescription
Namehttp://www\.oracle\.com/xml/jaxp/properties/entityExpansionLimit
DefinitionLimit the number of entity expansions.
ValueA positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown.
Default value64000
System propertyjdk\.xml\.entityExpansionLimit
Since7u45, 8

elementAttributeLimit

AttributeDescription
Namehttp://www\.oracle\.com/xml/jaxp/properties/elementAttributeLimit
DefinitionLimit the number of attributes an element can have.
ValueA positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown.
Default value10000
System propertyjdk\.xml\.elementAttributeLimit
Since7u45, 8

maxOccurLimit

AttributeDescription
Namehttp://www\.oracle\.com/xml/jaxp/properties/maxOccurLimit
DefinitionLimit 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".
ValueA positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown.
Default value5000
System propertyjdk\.xml\.maxOccurLimit
Since7u45, 8

totalEntitySizeLimit

AttributeDescription
Namehttp://www\.oracle\.com/xml/jaxp/properties/totalEntitySizeLimit
DefinitionLimit the total size of all entities that include general and parameter entities. The size is calculated as an aggregation of all entities.
ValueA positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown.
Default value5x10^7
System propertyjdk\.xml\.totalEntitySizeLimit
Since7u45, 8

maxGeneralEntitySizeLimit

AttributeDescription
Namehttp://www\.oracle\.com/xml/jaxp/properties/maxGeneralEntitySizeLimit
DefinitionLimit the maximum size of any general entities.
ValueA positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown.
Default value0
System propertyjdk\.xml\.maxGeneralEntitySizeLimit
Since7u45, 8

maxParameterEntitySizeLimit

AttributeDescription
Namehttp://www\.oracle\.com/xml/jaxp/properties/maxParameterEntitySizeLimit
DefinitionLimit the maximum size of any parameter entities, including the result of nesting multiple parameter entities.
ValueA positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown.
Default value1000000
System propertyjdk\.xml\.maxParameterEntitySizeLimit
Since7u45, 8

entityReplacementLimit

AttributeDescription
Namehttp://www\.oracle\.com/xml/jaxp/properties/entityReplacementLimit
DefinitionLimit the total number of nodes in all entity references.
ValueA positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown.
Default value3000000
System propertyjdk\.xml\.entityReplacementLimit
Since7u111, 8u101

maxElementDepth

AttributeDescription
Namehttp://www\.oracle\.com/xml/jaxp/properties/maxElementDepth
DefinitionLimit the maximum element depth.
ValueA positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown.
Default value0
System propertyjdk\.xml\.maxElementDepth
Since7u65, 8u11

maxXMLNameLimit

AttributeDescription
Namehttp://www\.oracle\.com/xml/jaxp/properties/maxXMLNameLimit
DefinitionLimit the maximum size of XML names, including element name, attribute name and namespace prefix and URI.
ValueA positive integer. A value less than or equal to 0 indicates no limit. If the value is not an integer, a NumericFormatException is thrown.
Default value1000
System propertyjdk\.xml\.maxXMLNameLimit
Since7u91, 8u65

Legacy System Properties

These properties, which were introduced since JDK 5.0 and 6, continue to be supported for backward compatibility.

System PropertySinceNew System Property
entityExpansionLimit1.5jdk.xml.entityExpansionLimit
elementAttributeLimit1.5jdk.xml.elementAttributeLimit
maxOccurLimit1.6jdk.xml.maxOccur

{java.home}/lib/jaxp.properties

The system properties can be specified in the jaxp\.properties file to define the behavior for all invocations of the JDK or JRE. The format is system\-property\-name=value . For example:

jdk.xml.maxGeneralEntitySizeLimit=1024