2
* Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
27
* Defines the Java APIs for XML Processing (JAXP).
30
* <li><a href="#JAXP">The JAXP APIs</a></li>
31
* <li><a href="#FacPro">Factories and Processors</a></li>
32
* <li><a href="#Conf">Configuration</a>
34
* <li><a href="#Conf_Properties">JAXP Properties</a></li>
35
* <li><a href="#Conf_SystemProperties">System Properties</a></li>
36
* <li><a href="#Conf_CF">Configuration File</a>
38
* <li><a href="#Conf_CF_Default">{@code jaxp.properties} File</a></li>
39
* <li><a href="#Conf_CF_SP">User-defined Configuration File</a></li>
42
* <li><a href="#Conf_PP">Property Precedence</a></li>
45
* <li><a href="#LookupMechanism">JAXP Lookup Mechanism</a>
47
* <li><a href="#LookupProcedure">Lookup Procedure</a></li>
50
* <li><a href="#implNote">Implementation Note</a></li>
53
* <h2 id="JAXP">The JAXP APIs</h2>
54
* JAXP comprises a set of APIs built upon a number of XML technologies and
55
* standards that are essential for XML processing. These include APIs for:
58
* <li>Parsing: the {@link javax.xml.parsers JAXP Parsing API} based on
59
* {@link org.w3c.dom Document Object Model (DOM)} and
60
* {@link org.xml.sax Simple API for XML Parsing (SAX)}, and
61
* {@link javax.xml.stream Streaming API for XML (StAX)};
63
* <li>Serializing: StAX and
64
* {@link javax.xml.transform Extensible Stylesheet Language Transformations (XSLT)};
66
* <li>Validation: the {@link javax.xml.validation JAXP Validation API}
67
* based on the XML Schema Definition Language;</li>
68
* <li>Transformation: the {@link javax.xml.transform JAXP Transformation API}
69
* or XSLT (Extensible Stylesheet Language Transformations);</li>
70
* <li>Querying and traversing XML documents: the
71
* {@link javax.xml.xpath XML XPath Language API (XPath)};</li>
72
* <li>Resolving external resources: the {@link javax.xml.catalog XML Catalog API};</li>
75
* <h2 id="FacPro">Factories and Processors</h2>
76
* Factories are the entry points of each API, providing methods to allow applications
77
* to set <a href="#Conf_Properties">JAXP Properties</a> programmatically, before
78
* creating processors. The <a href="#Conf">Configuration</a> section provides more
79
* details on this. Factories also support the
80
* <a href="#LookupMechanism">JAXP Lookup Mechanism</a>, in which applications can be
81
* deployed with third party implementations to use instead of JDK implementations
84
* Processors are aggregates of parsers (or readers), serializers (or writers),
85
* validators, and transformers that control and perform the processing in their
86
* respective areas. They are defined in their relevant packages.
87
* In the {@link javax.xml.parsers parsers} package for example,
88
* are the {@link javax.xml.parsers.DocumentBuilder DocumentBuilder} and
89
* {@link javax.xml.parsers.SAXParser SAXParser}, that represent the DOM and
92
* The processors are configured and instantiated with their corresponding factories.
93
* The DocumentBuilder and SAXParser for example are constructed with the
94
* {@link javax.xml.parsers.DocumentBuilderFactory DocumentBuilderFactory}
95
* and {@link javax.xml.parsers.SAXParserFactory SAXParserFactory} respectively.
97
* <h2 id="Conf">Configuration</h2>
98
* When a JAXP factory is invoked for the first time, it performs a configuration
99
* process to determine the implementation to be used and its subsequent behaviors.
100
* During configuration, the factory examines configuration sources such as the
101
* <a href="#Conf_Properties">JAXP Properties</a>,
102
* <a href="#Conf_SystemProperties">System Properties</a>,
103
* and the <a href="#Conf_CF">JAXP Configuration File</a>, and sets the values
104
* following the <a href="#Conf_PP">Property Precedence</a>. The terminologies and
105
* process are defined below.
107
* <h3 id="Conf_Properties">JAXP Properties</h3>
108
* JAXP properties are configuration settings that are applied to XML processors.
109
* They can be used to control and customize the behavior of a processor.
110
* Depending on the JAXP API that is being used, JAXP properties may be referred
111
* to as <em>Attributes, Properties</em>, or <em>Features</em>.
113
* <h3 id="Conf_SystemProperties">System Properties</h3>
114
* Select JAXP properties have corresponding System Properties allowing the properties
115
* to be set at runtime, on the command line, or within the
116
* <a href="#Conf_CF">JAXP Configuration File</a>.
117
* For example, the System Property {@code javax.xml.catalog.resolve} may be used
118
* to set the {@link javax.xml.catalog.CatalogFeatures CatalogFeatures}' RESOLVE
121
* The exact time at which system properties are read is unspecified. In order to
122
* ensure that the desired values are properly applied, applications should ensure
123
* that system properties are set appropriately prior to the creation of the first
124
* JAXP factory and are not modified thereafter.
126
* <h3 id="Conf_CF">Configuration File</h3>
127
* JAXP supports the use of configuration files for
128
* <a href="#LookupMechanism">specifying the implementation class to load for the JAXP factories</a>
129
* as well as for setting JAXP properties.
131
* Configuration files are Java {@link java.util.Properties} files that consist
132
* of mappings between system properties and their values defined by various APIs
133
* or processes. The following configuration file entries demonstrate setting the
134
* {@code javax.xml.parsers.DocumentBuilderFactory}
135
* and {@code CatalogFeatures.RESOLVE} properties:
138
* javax.xml.parsers.DocumentBuilderFactory=packagename.DocumentBuilderFactoryImpl
139
* javax.xml.catalog.resolve=strict
142
* <h4 id="Conf_CF_Default">{@code jaxp.properties} File</h4>
143
* By default, JAXP looks for the configuration file {@code jaxp.properties},
144
* located in the ${java.home}/conf directory; and if the file exists, loads the
145
* specified properties to customize the behavior of the XML factories and processors.
147
* The {@code jaxp.properties} file will be read only once during the initialization
148
* of the JAXP implementation and cached in memory. If there is an error accessing
149
* or reading the file, the configuration process proceeds as if the file does not exist.
151
* <h4 id="Conf_CF_SP">User-defined Configuration File</h4>
152
* In addition to the {@code jaxp.properties} file, the system property
153
* {@systemProperty java.xml.config.file} can be set to specify the location of
154
* a configuration file. If the {@code java.xml.config.file} property is included
155
* within a configuration file, it will be ignored.
158
* When the {@code java.xml.config.file} is specified, the configuration file will be
159
* read and the included properties will override the same properties that were
160
* defined in the {@code jaxp.properties} file. If the {@code java.xml.config.file}
161
* has not been set when the JAXP implementation is initialized, no further attempt
162
* will be made to check for its existence.
164
* The {@code java.xml.config.file} value must contain a valid pathname
165
* to a configuration file. If the pathname is not absolute, it will be considered
166
* relative to the working directory of the JVM.
167
* If there is an error reading the configuration file, the configuration process
168
* proceeds as if the {@code java.xml.config.file} property was not set.
169
* Implementations may optionally issue a warning message.
171
* <h3 id="Conf_PP">Property Precedence</h3>
172
* JAXP properties can be set in multiple ways, including by API methods, system
173
* properties, and the <a href="#Conf_CF">JAXP Configuration File</a>. When not
174
* explicitly set, they will be initialized with default values or more restrictive
176
* {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING FEATURE_SECURE_PROCESSING}
177
* (FSP) is enabled. The configuration order of precedence for properties is as
178
* follows, from highest to lowest:
182
* The APIs for factories or processors
188
* User-defined <a href="#Conf_CF">Configuration File</a>
191
* The default JAXP Configuration File <a href="#Conf_CF_Default">{@code jaxp.properties}</a>
194
* The default values for JAXP Properties. If the
195
* {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING FSP} is true,
196
* the default values will be set to process XML securely.
200
* Using the {@link javax.xml.catalog.CatalogFeatures CatalogFeatures}' RESOLVE
201
* property as an example, the following illustrates how these rules are applied:
204
* Properties specified with factory or processor APIs have the highest
205
* precedence. The following code effectively sets the RESOLVE property to
206
* {@code strict}, regardless of settings in any other configuration sources.
209
* DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
210
* dbf.setAttribute(CatalogFeatures.Feature.RESOLVE.getPropertyName(), "strict");
215
* If the property is not set on the factory as in the above code, a
216
* system property setting will be in effect.
218
* // in the following example, the RESOLVE property is set to 'continue'
219
* // for the entire application
220
* java -Djavax.xml.catalog.resolve=continue myApp
224
* If the property is not set on the factory, or using a system property,
225
* the setting in a configuration file will take effect. The following entry
226
* sets the property to '{@code continue}'.
228
* javax.xml.catalog.resolve=continue
233
* If the property is not set anywhere, it will be resolved to its
234
* default value that is '{@code strict}'.
238
* <h2 id="LookupMechanism">JAXP Lookup Mechanism</h2>
239
* JAXP defines an ordered lookup procedure to determine the implementation class
240
* to load for the JAXP factories. Factories that support the mechanism are listed
241
* in the table below along with the method, System Property, and System
242
* Default method to be used in the procedure.
244
* <table class="plain" id="Factories">
245
* <caption>JAXP Factories</caption>
248
* <th scope="col">Factory</th>
249
* <th scope="col">Method</th>
250
* <th scope="col">System Property</th>
251
* <th scope="col">System Default</th>
257
* <th scope="row" style="font-weight:normal" id="DATA">
258
* {@link javax.xml.datatype.DatatypeFactory DatatypeFactory}
260
* <td style="text-align:center">{@link javax.xml.datatype.DatatypeFactory#newInstance() newInstance()}</td>
261
* <td style="text-align:center">{@code javax.xml.datatype.DatatypeFactory}</td>
262
* <td style="text-align:center">{@link javax.xml.datatype.DatatypeFactory#newDefaultInstance() newDefaultInstance()}</td>
265
* <th scope="row" style="font-weight:normal" id="DocumentBuilderFactory">
266
* {@link javax.xml.parsers.DocumentBuilderFactory DocumentBuilderFactory}
268
* <td style="text-align:center">{@link javax.xml.parsers.DocumentBuilderFactory#newInstance() newInstance()}</td>
269
* <td style="text-align:center">{@code javax.xml.parsers.DocumentBuilderFactory}</td>
270
* <td style="text-align:center">{@link javax.xml.parsers.DocumentBuilderFactory#newDefaultInstance() newDefaultInstance()}</td>
273
* <th scope="row" style="font-weight:normal" id="SAXParserFactory">
274
* {@link javax.xml.parsers.SAXParserFactory SAXParserFactory}
276
* <td style="text-align:center">{@link javax.xml.parsers.SAXParserFactory#newInstance() newInstance()}</td>
277
* <td style="text-align:center">{@code javax.xml.parsers.SAXParserFactory}</td>
278
* <td style="text-align:center">{@link javax.xml.parsers.SAXParserFactory#newDefaultInstance() newDefaultInstance()}</td>
281
* <th scope="row" style="font-weight:normal" id="StAXEvent">
282
* {@link javax.xml.stream.XMLEventFactory XMLEventFactory}
284
* <td style="text-align:center">{@link javax.xml.stream.XMLEventFactory#newFactory() newFactory()}</td>
285
* <td style="text-align:center">{@code javax.xml.stream.XMLEventFactory}</td>
286
* <td style="text-align:center">{@link javax.xml.stream.XMLEventFactory#newDefaultFactory() newDefaultFactory()}</td>
289
* <th scope="row" style="font-weight:normal" id="StAXInput">
290
* {@link javax.xml.stream.XMLInputFactory XMLInputFactory}
292
* <td style="text-align:center">{@link javax.xml.stream.XMLInputFactory#newFactory() newFactory()}</td>
293
* <td style="text-align:center">{@code javax.xml.stream.XMLInputFactory}</td>
294
* <td style="text-align:center">{@link javax.xml.stream.XMLInputFactory#newDefaultFactory() newDefaultFactory()}</td>
297
* <th scope="row" style="font-weight:normal" id="StAXOutput">
298
* {@link javax.xml.stream.XMLOutputFactory XMLOutputFactory}
300
* <td style="text-align:center">{@link javax.xml.stream.XMLOutputFactory#newFactory() newFactory()}</td>
301
* <td style="text-align:center">{@code javax.xml.stream.XMLOutputFactory}</td>
302
* <td style="text-align:center">{@link javax.xml.stream.XMLOutputFactory#newDefaultFactory() newDefaultFactory()}</td>
305
* <th scope="row" style="font-weight:normal" id="XSLT">
306
* {@link javax.xml.transform.TransformerFactory TransformerFactory}
308
* <td style="text-align:center">{@link javax.xml.transform.TransformerFactory#newInstance() newInstance()}</td>
309
* <td style="text-align:center">{@code javax.xml.transform.TransformerFactory}</td>
310
* <td style="text-align:center">{@link javax.xml.transform.TransformerFactory#newDefaultInstance() newDefaultInstance()}</td>
313
* <th scope="row" style="font-weight:normal" id="SchemaFactory">
314
* {@link javax.xml.validation.SchemaFactory SchemaFactory}
316
* <td style="text-align:center">{@link javax.xml.validation.SchemaFactory#newInstance(java.lang.String) newInstance(schemaLanguage)}</td>
317
* <td style="text-align:center">{@code javax.xml.validation.SchemaFactory:}<i>schemaLanguage</i>[1]</td>
318
* <td style="text-align:center">{@link javax.xml.validation.SchemaFactory#newDefaultInstance() newDefaultInstance()}</td>
321
* <th scope="row" style="font-weight:normal" id="XPathFactory">
322
* {@link javax.xml.xpath.XPathFactory XPathFactory}
324
* <td style="text-align:center">{@link javax.xml.xpath.XPathFactory#newInstance(java.lang.String) newInstance(uri)}</td>
325
* <td style="text-align:center">{@link javax.xml.xpath.XPathFactory#DEFAULT_PROPERTY_NAME DEFAULT_PROPERTY_NAME} + ":uri"[2]</td>
326
* <td style="text-align:center">{@link javax.xml.xpath.XPathFactory#newDefaultInstance() newDefaultInstance()}</td>
331
* <b>[1]</b> where <i>schemaLanguage</i> is the parameter to the
332
* {@link javax.xml.validation.SchemaFactory#newInstance(java.lang.String) newInstance(schemaLanguage)}
335
* <b>[2]</b> where <i>uri</i> is the parameter to the
336
* {@link javax.xml.xpath.XPathFactory#newInstance(java.lang.String) newInstance(uri)}
339
* <h3 id="LookupProcedure">Lookup Procedure</h3>
340
* The order of precedence for locating the implementation class of a
341
* <a href="#Factories">JAXP Factory</a> is as follows, from highest to lowest:
344
* The system property as listed in the column System Property of the table
345
* <a href="#Factories">JAXP Factories</a> above
349
* The <a href="#Conf_CF">Configuration File</a>
353
* The service-provider loading facility, defined by the
354
* {@link java.util.ServiceLoader} class, to attempt to locate and load an
355
* implementation of the service using the {@linkplain
356
* java.util.ServiceLoader#load(java.lang.Class) default loading mechanism}:
357
* the service-provider loading facility will use the {@linkplain
358
* java.lang.Thread#getContextClassLoader() current thread's context class loader}
359
* to attempt to load the service. If the context class
360
* loader is null, the {@linkplain
361
* ClassLoader#getSystemClassLoader() system class loader} will be used.
363
* <h3>{@link javax.xml.validation.SchemaFactory SchemaFactory}</h3>
364
* In case of the {@link javax.xml.validation.SchemaFactory SchemaFactory},
365
* each potential service provider is required to implement the method
366
* {@link javax.xml.validation.SchemaFactory#isSchemaLanguageSupported(java.lang.String)
367
* isSchemaLanguageSupported(String schemaLanguage)}.
368
* The first service provider found that supports the specified schema language
371
* <h3>{@link javax.xml.xpath.XPathFactory XPathFactory}</h3>
372
* In case of the {@link javax.xml.xpath.XPathFactory XPathFactory},
373
* each potential service provider is required to implement the method
374
* {@link javax.xml.xpath.XPathFactory#isObjectModelSupported(String objectModel)
375
* isObjectModelSupported(String objectModel)}.
376
* The first service provider found that supports the specified object model is
381
* Otherwise, the {@code system-default} implementation is returned, which is
382
* equivalent to calling the {@code newDefaultInstance() or newDefaultFactory()}
383
* method as shown in column System Default of the table
384
* <a href="#Factories">JAXP Factories</a> above.
386
* <h3>{@link javax.xml.validation.SchemaFactory SchemaFactory}</h3>
387
* In case of the {@link javax.xml.validation.SchemaFactory SchemaFactory},
388
* there must be a {@linkplain javax.xml.validation.SchemaFactory#newDefaultInstance()
389
* platform default} {@code SchemaFactory} for W3C XML Schema.
391
* <h3>{@link javax.xml.xpath.XPathFactory XPathFactory}</h3>
392
* In case of the {@link javax.xml.xpath.XPathFactory XPathFactory},
394
* {@linkplain javax.xml.xpath.XPathFactory#newDefaultInstance() platform default}
395
* {@code XPathFactory} for the W3C DOM, i.e.
396
* {@link javax.xml.xpath.XPathFactory#DEFAULT_OBJECT_MODEL_URI DEFAULT_OBJECT_MODEL_URI}.
401
* <div id="implNote"></div>
405
* <li><a href="#JDKCATALOG">JDK built-in Catalog</a>
407
* <li><a href="#JC_PROCESS">External Resource Resolution Process with the built-in Catalog</a></li>
410
* <li><a href="#IN_ISFP">Implementation Specific Properties</a>
412
* <li><a href="#Processor">Processor Support</a></li>
413
* <li><a href="#IN_ISFPtable">List of Implementation Specific Properties</a></li>
414
* <li><a href="#IN_Legacy">Legacy Property Names (deprecated)</a></li>
419
* <h2 id="JDKCATALOG">JDK built-in Catalog</h2>
420
* The JDK has a built-in catalog that hosts the following DTDs defined by the Java Platform:
422
* <li>DTD for {@link java.util.prefs.Preferences java.util.prefs.Preferences}, preferences.dtd</li>
423
* <li>DTD for {@link java.util.Properties java.util.Properties}, properties.dtd</li>
426
* The catalog is loaded once when the first JAXP processor factory is created.
428
* <h3 id="JC_PROCESS">External Resource Resolution Process with the built-in Catalog</h3>
429
* The JDK creates a {@link javax.xml.catalog.CatalogResolver CatalogResolver}
430
* with the built-in catalog when needed. This CatalogResolver is used as the
431
* default external resource resolver.
433
* XML processors may use resolvers (such as {@link org.xml.sax.EntityResolver EntityResolver},
434
* {@link javax.xml.stream.XMLResolver XMLResolver}, and {@link javax.xml.catalog.CatalogResolver CatalogResolver})
435
* to handle external references. In the absence of the user-defined resolvers,
436
* the JDK XML processors fall back to the default CatalogResolver to attempt to
437
* find a resolution before making a connection to fetch the resources. The fall-back
438
* also takes place if a user-defined resolver exists but allows the process to
439
* continue when unable to resolve the resource.
441
* If the default CatalogResolver is unable to locate a resource, it may signal
442
* the XML processors to continue processing, or skip the resource, or
443
* throw a CatalogException. The behavior is configured with the
444
* <a href="#JDKCATALOG_RESOLVE">{@code jdk.xml.jdkcatalog.resolve}</a> property.
446
* <h2 id="IN_ISFP">Implementation Specific Properties</h2>
447
* In addition to the standard <a href="#Conf_Properties">JAXP Properties</a>,
448
* the JDK implementation supports a number of implementation specific properties
449
* whose name is prefixed by "{@code jdk.xml.}". These properties also follow the
450
* configuration process as defined in the <a href="#Conf">Configuration</a> section.
452
* Refer to the <a href="#Properties">Implementation Specific Properties</a> table
453
* for the list of properties supported by the JDK implementation.
455
* <h3 id="Processor">Processor Support</h3>
456
* The properties may be supported by one or more processors as listed in the table
457
* below. Depending on the type of the property, they may be set via
458
* Method 1: setAttribute/Parameter/Property or 2: setFeature as illustrated
459
* in the relevant columns.
461
* <table class="plain" id="Processors">
462
* <caption>Processors</caption>
465
* <th scope="col">ID</th>
466
* <th scope="col">Name</th>
467
* <th scope="col">Method 1: setAttribute/Parameter/Property</th>
468
* <th scope="col">Method 2: setFeature</th>
474
* <th scope="row" style="font-weight:normal" id="DOM">DOM</th>
475
* <td style="text-align:center">DOM Parser</td>
477
* {@code DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();}<br>
478
* {@code dbf.setAttribute(name, value);}
481
* {@code DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();}<br>
482
* {@code dbf.setFeature(name, value);}
486
* <th scope="row" style="font-weight:normal" id="SAX">SAX</th>
487
* <td style="text-align:center">SAX Parser</td>
489
* {@code SAXParserFactory spf = SAXParserFactory.newInstance();}<br>
490
* {@code SAXParser parser = spf.newSAXParser();}<br>
491
* {@code parser.setProperty(name, value);}
494
* {@code SAXParserFactory spf = SAXParserFactory.newInstance();}<br>
495
* {@code spf.setFeature(name, value);}<br>
499
* <th scope="row" style="font-weight:normal" id="StAX">StAX</th>
500
* <td style="text-align:center">StAX Parser</td>
502
* {@code XMLInputFactory xif = XMLInputFactory.newInstance();}<br>
503
* {@code xif.setProperty(name, value);}
506
* {@code XMLInputFactory xif = XMLInputFactory.newInstance();}<br>
507
* {@code xif.setProperty(name, value);}
511
* <th scope="row" style="font-weight:normal" id="Validation">Validation</th>
512
* <td style="text-align:center">XML Validation API</td>
514
* {@code SchemaFactory schemaFactory = SchemaFactory.newInstance(schemaLanguage);}<br>
515
* {@code schemaFactory.setProperty(name, value);}
518
* {@code SchemaFactory schemaFactory = SchemaFactory.newInstance(schemaLanguage);}<br>
519
* {@code schemaFactory.setFeature(name, value);}
523
* <th scope="row" style="font-weight:normal" id="Transform">Transform</th>
524
* <td style="text-align:center">XML Transform API</td>
526
* {@code TransformerFactory factory = TransformerFactory.newInstance();}<br>
527
* {@code factory.setAttribute(name, value);}
530
* {@code TransformerFactory factory = TransformerFactory.newInstance();}<br>
531
* {@code factory.setFeature(name, value);}
535
* <th scope="row" style="font-weight:normal" id="XSLTCSerializer">XSLTC Serializer</th>
536
* <td style="text-align:center">XSLTC Serializer</td>
538
* {@code Transformer transformer = TransformerFactory.newInstance().newTransformer();}<br>
539
* {@code transformer.setOutputProperty(name, value);}
545
* <th scope="row" style="font-weight:normal" id="DOMLS">DOMLS</th>
546
* <td style="text-align:center">DOM Load and Save</td>
548
* {@code LSSerializer serializer = domImplementation.createLSSerializer();} <br>
549
* {@code serializer.getDomConfig().setParameter(name, value);}
555
* <th scope="row" style="font-weight:normal" id="XPATH">XPath</th>
556
* <td style="text-align:center">XPath</td>
558
* {@code XPathFactory factory = XPathFactory.newInstance();}<br>
559
* {@code factory.setProperty(name, value);}
562
* {@code XPathFactory factory = XPathFactory.newInstance();} <br>
563
* {@code factory.setFeature(name, value);}
569
* <div id="IN_ISFPtable"></div>
570
* <table class="striped" id="Properties">
571
* <caption>Implementation Specific Properties</caption>
574
* <th scope="col" rowspan="2">Full Name (prefix {@code jdk.xml.})
575
* <a href="#Note1">[1]</a></th>
576
* <th scope="col" rowspan="2">Description</th>
577
* <th scope="col" rowspan="2">System Property <a href="#Note2">[2]</a></th>
578
* <th scope="col" colspan="4" style="text-align:center">Value <a href="#Note3">[3]</a></th>
579
* <th scope="col" rowspan="2">Security <a href="#Note4">[4]</a></th>
580
* <th scope="col" colspan="2">Supported Processor <a href="#Note5">[5]</a></th>
581
* <th scope="col" rowspan="2">Since <a href="#Note6">[6]</a></th>
584
* <th scope="col">Type</th>
585
* <th scope="col">Value</th>
586
* <th scope="col">Default</th>
587
* <th scope="col">Enforced</th>
588
* <th scope="col">ID</th>
589
* <th scope="col">Set Method</th>
596
* <td id="EELimit">{@systemProperty jdk.xml.entityExpansionLimit}</td>
597
* <td>Limits the number of entity expansions.
599
* <td style="text-align:center" rowspan="11">yes</td>
600
* <td style="text-align:center" rowspan="9">Integer</td>
602
* A positive integer. A value less than or equal to 0 indicates no limit.
603
* If the value is not an integer, a NumberFormatException is thrown.
605
* <td style="text-align:center">64000</td>
606
* <td style="text-align:center">64000</td>
607
* <td style="text-align:center" rowspan="9">Yes</td>
608
* <td style="text-align:center" rowspan="9">
609
* <a href="#DOM">DOM</a><br>
610
* <a href="#SAX">SAX</a><br>
611
* <a href="#StAX">StAX</a><br>
612
* <a href="#Validation">Validation</a><br>
613
* <a href="#Transform">Transform</a>
615
* <td style="text-align:center" rowspan="16"><a href="#Processor">Method 1</a></td>
616
* <td style="text-align:center" rowspan="9">8</td>
619
* <td id="EALimit">{@systemProperty jdk.xml.elementAttributeLimit}</td>
620
* <td>Limits the number of attributes an element can have.
622
* <td style="text-align:center">10000</td>
623
* <td style="text-align:center">10000</td>
626
* <td id="OccurLimit">{@systemProperty jdk.xml.maxOccurLimit}</td>
627
* <td>Limits the number of content model nodes that may be created when building
628
* a grammar for a W3C XML Schema that contains maxOccurs attributes with values
629
* other than "unbounded".
631
* <td style="text-align:center">5000</td>
632
* <td style="text-align:center">5000</td>
635
* <td id="SizeLimit">{@systemProperty jdk.xml.totalEntitySizeLimit}</td>
636
* <td>Limits the total size of all entities that include general and parameter
637
* entities. The size is calculated as an aggregation of all entities.
639
* <td style="text-align:center">5x10^7</td>
640
* <td style="text-align:center">5x10^7</td>
643
* <td id="GELimit">{@systemProperty jdk.xml.maxGeneralEntitySizeLimit}</td>
644
* <td>Limits the maximum size of any general entities.
646
* <td style="text-align:center">0</td>
647
* <td style="text-align:center">0</td>
650
* <td id="PELimit">{@systemProperty jdk.xml.maxParameterEntitySizeLimit}</td>
651
* <td>Limits the maximum size of any parameter entities, including the result
652
* of nesting multiple parameter entities.
654
* <td style="text-align:center">10^6</td>
655
* <td style="text-align:center">10^6</td>
658
* <td id="ERLimit">{@systemProperty jdk.xml.entityReplacementLimit}</td>
659
* <td>Limits the total number of nodes in all entity references.
661
* <td style="text-align:center">3x10^6</td>
662
* <td style="text-align:center">3x10^6</td>
665
* <td id="ElementDepth">{@systemProperty jdk.xml.maxElementDepth}</td>
666
* <td>Limits the maximum element depth.
668
* <td style="text-align:center">0</td>
669
* <td style="text-align:center">0</td>
672
* <td id="NameLimit">{@systemProperty jdk.xml.maxXMLNameLimit}</td>
673
* <td>Limits the maximum size of XML names, including element name, attribute
674
* name and namespace prefix and URI.
676
* <td style="text-align:center">1000</td>
677
* <td style="text-align:center">1000</td>
681
* <td id="ISSTANDALONE">{@systemProperty jdk.xml.isStandalone}</td>
682
* <td>Indicates that the serializer should treat the output as a
683
* standalone document. The property can be used to ensure a newline is written
684
* after the XML declaration. Unlike the property
685
* {@link org.w3c.dom.ls.LSSerializer#getDomConfig() xml-declaration}, this property
686
* does not have an effect on whether an XML declaration should be written out.
688
* <td style="text-align:center">boolean</td>
689
* <td style="text-align:center">true/false</td>
690
* <td style="text-align:center">false</td>
691
* <td style="text-align:center">N/A</td>
692
* <td style="text-align:center">No</td>
693
* <td style="text-align:center"><a href="#DOMLS">DOMLS</a></td>
694
* <td style="text-align:center">17</td>
697
* <td id="XSLTCISSTANDALONE">{@systemProperty jdk.xml.xsltcIsStandalone}</td>
698
* <td>Indicates that the <a href="#XSLTCSerializer">XSLTC serializer</a> should
699
* treat the output as a standalone document. The property can be used to ensure
700
* a newline is written after the XML declaration. Unlike the property
701
* {@link javax.xml.transform.OutputKeys#OMIT_XML_DECLARATION OMIT_XML_DECLARATION},
702
* this property does not have an effect on whether an XML declaration should be
705
* This property behaves similar to that for <a href="#DOMLS">DOMLS</a> above,
706
* except that it is for the <a href="#XSLTCSerializer">XSLTC Serializer</a>
707
* and its value is a String.
709
* <td style="text-align:center">String</td>
710
* <td style="text-align:center">yes/no</td>
711
* <td style="text-align:center">no</td>
712
* <td style="text-align:center">N/A</td>
713
* <td style="text-align:center">No</td>
714
* <td style="text-align:center"><a href="#XSLTCSerializer">XSLTC Serializer</a></td>
715
* <td style="text-align:center">17</td>
718
* <td id="cdataChunkSize">{@systemProperty jdk.xml.cdataChunkSize}</td>
719
* <td>Instructs the parser to return the data in a CData section in a single chunk
720
* when the property is zero or unspecified, or in multiple chunks when it is greater
721
* than zero. The parser shall split the data by linebreaks, and any chunks that are
722
* larger than the specified size to ones that are equal to or smaller than the size.
724
* <td style="text-align:center">yes</td>
725
* <td style="text-align:center">Integer</td>
726
* <td>A positive integer. A value less than
727
* or equal to 0 indicates that the property is not specified. If the value is not
728
* an integer, a NumberFormatException is thrown.</td>
729
* <td style="text-align:center">0</td>
730
* <td style="text-align:center">N/A</td>
731
* <td style="text-align:center">No</td>
732
* <td style="text-align:center"><a href="#SAX">SAX</a><br><a href="#StAX">StAX</a></td>
733
* <td style="text-align:center">9</td>
736
* <td id="extensionClassLoader">jdk.xml.extensionClassLoader</td>
737
* <td>Sets a non-null ClassLoader instance to be used for loading XSLTC java
738
* extension functions.
740
* <td style="text-align:center">no</td>
741
* <td style="text-align:center">Object</td>
742
* <td>A reference to a ClassLoader object. Null if the value is not specified.</td>
743
* <td style="text-align:center">null</td>
744
* <td style="text-align:center">N/A</td>
745
* <td style="text-align:center">No</td>
746
* <td style="text-align:center"><a href="#Transform">Transform</a></td>
747
* <td style="text-align:center">9</td>
750
* <td id="xpathExprGrpLimit">jdk.xml.xpathExprGrpLimit</td>
751
* <td>Limits the number of groups an XPath expression can contain.
753
* <td style="text-align:center" rowspan="3">yes</td>
754
* <td style="text-align:center" rowspan="3">Integer</td>
755
* <td rowspan="3">A positive integer. A value less than or equal to 0 indicates no limit.
756
* If the value is not an integer, a NumberFormatException is thrown. </td>
757
* <td style="text-align:center">10</td>
758
* <td style="text-align:center">10</td>
759
* <td style="text-align:center" rowspan="3">Yes</td>
760
* <td style="text-align:center" rowspan="2">
761
* <a href="#Transform">Transform</a><br>
762
* <a href="#XPATH">XPath</a>
764
* <td style="text-align:center" rowspan="3">19</td>
767
* <td id="xpathExprOpLimit">jdk.xml.xpathExprOpLimit</td>
768
* <td>Limits the number of operators an XPath expression can contain.
770
* <td style="text-align:center">100</td>
771
* <td style="text-align:center">100</td>
774
* <td id="xpathTotalOpLimit">jdk.xml.xpathTotalOpLimit</td>
775
* <td>Limits the total number of XPath operators in an XSL Stylesheet.
777
* <td style="text-align:center">10000</td>
778
* <td style="text-align:center">10000</td>
779
* <td style="text-align:center">
780
* <a href="#Transform">Transform</a><br>
784
* <td id="ExtFunc">{@systemProperty jdk.xml.enableExtensionFunctions}</td>
785
* <td>Determines if XSLT and XPath extension functions are to be allowed.
787
* <td style="text-align:center" rowspan="5">yes</td>
788
* <td style="text-align:center" rowspan="3">Boolean</td>
790
* true or false. True indicates that extension functions are allowed; False otherwise.
792
* <td style="text-align:center">true</td>
793
* <td style="text-align:center">false</td>
794
* <td style="text-align:center">Yes</td>
795
* <td style="text-align:center">
796
* <a href="#Transform">Transform</a><br>
797
* <a href="#XPATH">XPath</a>
799
* <td style="text-align:center"><a href="#Processor">Method 2</a></td>
800
* <td style="text-align:center">8</td>
803
* <td id="ORParser">{@systemProperty jdk.xml.overrideDefaultParser}</td>
804
* <td>Enables the use of a 3rd party's parser implementation to override the
805
* system-default parser for the JDK's Transform, Validation and XPath implementations.
808
* true or false. True enables the use of 3rd party's parser implementations
809
* to override the system-default implementation during XML Transform, Validation
810
* or XPath operation. False disables the use of 3rd party's parser
813
* <td style="text-align:center">false</td>
814
* <td style="text-align:center">false</td>
815
* <td style="text-align:center">Yes</td>
816
* <td style="text-align:center">
817
* <a href="#Transform">Transform</a><br>
818
* <a href="#Validation">Validation</a><br>
819
* <a href="#XPATH">XPath</a>
821
* <td style="text-align:center"><a href="#Processor">Method 2</a></td>
822
* <td style="text-align:center">9</td>
825
* <td id="symbolTable">{@systemProperty jdk.xml.resetSymbolTable}</td>
826
* <td>Instructs the parser to reset its internal symbol table during each parse operation.
829
* true or false. True indicates that the SymbolTable associated with a parser needs to be
830
* reallocated during each parse operation.<br>
831
* False indicates that the parser's SymbolTable instance shall be reused
832
* during subsequent parse operations.
834
* <td style="text-align:center">false</td>
835
* <td style="text-align:center">N/A</td>
836
* <td style="text-align:center">No</td>
837
* <td style="text-align:center">
838
* <a href="#SAX">SAX</a>
840
* <td style="text-align:center"><a href="#Processor">Method 2</a></td>
841
* <td style="text-align:center">9</td>
844
* <td id="DTD">{@systemProperty jdk.xml.dtd.support}<a href="#Note7">[7]</a></td>
845
* <td>Instructs the parser to handle DTDs in accordance with the setting of this property.
849
* {@code allow} -- indicates that the parser shall continue processing DTDs;
852
* {@code ignore} -- indicates that the parser shall skip DTDs;
855
* {@code deny} -- indicates that the parser shall reject DTDs as an error.
856
* The parser shall report the error in accordance with its relevant specification.
860
* <td style="text-align:center">String</td>
862
* {@code allow, ignore, and deny}. Values are case-insensitive.
864
* <td style="text-align:center">allow</td>
865
* <td style="text-align:center">No</td>
866
* <td style="text-align:center">Yes</td>
867
* <td style="text-align:center">
868
* <a href="#DOM">DOM</a><br>
869
* <a href="#SAX">SAX</a><br>
870
* <a href="#StAX">StAX</a><br>
871
* <a href="#Validation">Validation</a><br>
872
* <a href="#Transform">Transform</a>
874
* <td style="text-align:center"><a href="#Processor">Method 1</a></td>
875
* <td style="text-align:center">22</td>
878
* <td id="JDKCATALOG_RESOLVE">{@systemProperty jdk.xml.jdkcatalog.resolve}</td>
879
* <td>Instructs the JDK default CatalogResolver to act in accordance with the setting
880
* of this property when unable to resolve an external reference with the built-in Catalog.
884
* {@code continue} -- Indicates that the processing should continue
887
* {@code ignore} -- Indicates that the reference is skipped
890
* {@code strict} -- Indicates that the resolver should throw a CatalogException
894
* <td style="text-align:center">String</td>
896
* {@code continue, ignore, and strict}. Values are case-insensitive.
898
* <td style="text-align:center">continue</td>
899
* <td style="text-align:center">No</td>
900
* <td style="text-align:center">Yes</td>
901
* <td style="text-align:center">
902
* <a href="#DOM">DOM</a><br>
903
* <a href="#SAX">SAX</a><br>
904
* <a href="#StAX">StAX</a><br>
905
* <a href="#Validation">Validation</a><br>
906
* <a href="#Transform">Transform</a>
908
* <td style="text-align:center"><a href="#Processor">Method 1</a></td>
909
* <td style="text-align:center">22</td>
914
* <b>[1]</b> The full name of a property should be used to set the property.
916
* <b>[2]</b> A value "yes" indicates there is a corresponding System Property
917
* for the property, "no" otherwise. The name of the System Property is the same
918
* as that of the property.
921
* <b>[3]</b> The value must be exactly as listed in this table, case-sensitive.
922
* The value of the corresponding System Property is the String representation of
923
* the property value. If the type is boolean, the system property is true only
924
* if it is "true"; If the type is String, the system property is true only if
925
* it is exactly the same string representing the positive value (e.g. "yes" for
926
* {@code xsltcIsStandalone}); The system property is false otherwise. If the type
927
* is Integer, the value of the System Property is the String representation of
928
* the value (e.g. "64000" for {@code entityExpansionLimit}).
931
* <b>[4]</b> A value "yes" indicates the property is a Security Property. As indicated
932
* in the <a href="#Conf_PP">Property Precedence</a>, the values listed in the column
933
* {@code enforced} will be used to initialize these properties when
934
* {@link javax.xml.XMLConstants#FEATURE_SECURE_PROCESSING FSP} is true.
937
* <b>[5]</b> One or more processors that support the property. The IDs and Set Method
938
* are as shown in the table <a href="#Processor">Processors</a>.
940
* <b>[6]</b> Indicates the initial release the property is introduced.
942
* <b>[7]</b> The {@code jdk.xml.dtd.support} property complements the two existing
943
* DTD-related properties, {@code disallow-doctype-decl}(fully qualified name:
944
* {@code http://apache.org/xml/features/disallow-doctype-decl}) and supportDTD
945
* ({@code javax.xml.stream.supportDTD}), by providing a uniformed support for the
946
* processors listed and a system property that can be used in the
947
* <a href="#Conf_CF">JAXP Configuration File</a>. When {@code disallow-doctype-decl} is
948
* set on the DOM or SAX factory, or supportDTD on StAX factory, the {@code jdk.xml.dtd.support}
949
* property will have no effect.
951
* These three properties control whether DTDs as a whole shall be processed. When
952
* they are set to deny or ignore, other properties that regulate a part or an
953
* aspect of DTD shall have no effect.
955
* <h3 id="IN_Legacy">Legacy Property Names (deprecated)</h3>
956
* JDK releases prior to JDK 17 support the use of URI style prefix for properties.
957
* These legacy property names are <b>deprecated</b> as of JDK 17 and may be removed
958
* in future releases. If both new and legacy properties are set, the new property
959
* names take precedence regardless of how and where they are set. The overriding order
960
* as defined in <a href="#Conf_PP">Property Precedence</a> thus becomes:
963
* <li>Value set on factories or processors using new property names.</li>
964
* <li>Value set on factories or processors using <b>legacy property names</b>;</li>
965
* <li>Value set as System Property;</li>
966
* <li>Value set in the configuration file;</li>
967
* <li>Value set by FEATURE_SECURE_PROCESSING;</li>
968
* <li>The default value;</li>
971
* The following table lists the properties and their corresponding legacy names.
973
* <table class="striped" id="LegacyProperties">
974
* <caption>Legacy Property Names (deprecated since 17)</caption>
978
* <th>Legacy Property Name(s)</th>
983
* <td>{@systemProperty jdk.xml.entityExpansionLimit}</td>
984
* <td>{@code http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit}</td>
987
* <td>{@systemProperty jdk.xml.elementAttributeLimit}</td>
988
* <td>{@code http://www.oracle.com/xml/jaxp/properties/elementAttributeLimit}</td>
991
* <td>{@systemProperty jdk.xml.maxOccurLimit}</td>
992
* <td>{@code http://www.oracle.com/xml/jaxp/properties/maxOccurLimit}</td>
995
* <td>{@systemProperty jdk.xml.totalEntitySizeLimit}</td>
996
* <td>{@code http://www.oracle.com/xml/jaxp/properties/totalEntitySizeLimit}</td>
999
* <td>{@systemProperty jdk.xml.maxGeneralEntitySizeLimit}</td>
1000
* <td>{@code http://www.oracle.com/xml/jaxp/properties/maxGeneralEntitySizeLimit}</td>
1003
* <td>{@systemProperty jdk.xml.maxParameterEntitySizeLimit}</td>
1004
* <td>{@code http://www.oracle.com/xml/jaxp/properties/maxParameterEntitySizeLimit}</td>
1007
* <td>{@systemProperty jdk.xml.entityReplacementLimit}</td>
1008
* <td>{@code http://www.oracle.com/xml/jaxp/properties/entityReplacementLimit}</td>
1011
* <td>{@systemProperty jdk.xml.maxElementDepth}</td>
1012
* <td>{@code http://www.oracle.com/xml/jaxp/properties/maxElementDepth}</td>
1015
* <td>{@systemProperty jdk.xml.maxXMLNameLimit}</td>
1016
* <td>{@code http://www.oracle.com/xml/jaxp/properties/maxXMLNameLimit}</td>
1019
* <td>{@systemProperty jdk.xml.isStandalone}</td>
1020
* <td>{@code http://www.oracle.com/xml/jaxp/properties/isStandalone}</td>
1023
* <td>{@systemProperty jdk.xml.xsltcIsStandalone}</td>
1024
* <td>{@code http://www.oracle.com/xml/is-standalone}<br>
1025
* {@code http://www.oracle.com/xml/jaxp/properties/xsltcIsStandalone}</td>
1028
* <td>{@code jdk.xml.extensionClassLoader}</td>
1029
* <td>{@code jdk.xml.transform.extensionClassLoader}</td>
1032
* <td>{@systemProperty jdk.xml.enableExtensionFunctions}</td>
1033
* <td>{@code http://www.oracle.com/xml/jaxp/properties/enableExtensionFunctions}</td>
1038
* @uses javax.xml.datatype.DatatypeFactory
1039
* @uses javax.xml.parsers.DocumentBuilderFactory
1040
* @uses javax.xml.parsers.SAXParserFactory
1041
* @uses javax.xml.stream.XMLEventFactory
1042
* @uses javax.xml.stream.XMLInputFactory
1043
* @uses javax.xml.stream.XMLOutputFactory
1044
* @uses javax.xml.transform.TransformerFactory
1045
* @uses javax.xml.validation.SchemaFactory
1046
* @uses javax.xml.xpath.XPathFactory
1047
* @uses org.xml.sax.XMLReader
1054
exports javax.xml.catalog;
1055
exports javax.xml.datatype;
1056
exports javax.xml.namespace;
1057
exports javax.xml.parsers;
1058
exports javax.xml.stream;
1059
exports javax.xml.stream.events;
1060
exports javax.xml.stream.util;
1061
exports javax.xml.transform;
1062
exports javax.xml.transform.dom;
1063
exports javax.xml.transform.sax;
1064
exports javax.xml.transform.stax;
1065
exports javax.xml.transform.stream;
1066
exports javax.xml.validation;
1067
exports javax.xml.xpath;
1068
exports org.w3c.dom;
1069
exports org.w3c.dom.bootstrap;
1070
exports org.w3c.dom.events;
1071
exports org.w3c.dom.ls;
1072
exports org.w3c.dom.ranges;
1073
exports org.w3c.dom.traversal;
1074
exports org.w3c.dom.views;
1075
exports org.xml.sax;
1076
exports org.xml.sax.ext;
1077
exports org.xml.sax.helpers;
1079
exports com.sun.org.apache.xml.internal.dtm to
1081
exports com.sun.org.apache.xml.internal.utils to
1083
exports com.sun.org.apache.xpath.internal to
1085
exports com.sun.org.apache.xpath.internal.compiler to
1087
exports com.sun.org.apache.xpath.internal.functions to
1089
exports com.sun.org.apache.xpath.internal.objects to
1091
exports com.sun.org.apache.xpath.internal.res to
1094
uses javax.xml.datatype.DatatypeFactory;
1095
uses javax.xml.parsers.DocumentBuilderFactory;
1096
uses javax.xml.parsers.SAXParserFactory;
1097
uses javax.xml.stream.XMLEventFactory;
1098
uses javax.xml.stream.XMLInputFactory;
1099
uses javax.xml.stream.XMLOutputFactory;
1100
uses javax.xml.transform.TransformerFactory;
1101
uses javax.xml.validation.SchemaFactory;
1102
uses javax.xml.xpath.XPathFactory;
1103
uses org.xml.sax.XMLReader;