9 * by Oracle in the LICENSE file that accompanied this code. 10 * 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). 16 * 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. 20 * 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 23 * questions. 24 */ 25 26 package javax.xml; 27 28 /** 29 * <p>Utility class to contain basic XML values as constants.</p> 30 * 31 * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a> 32 * @see <a href="http://www.w3.org/TR/xml11/">Extensible Markup Language (XML) 1.1</a> 33 * @see <a href="http://www.w3.org/TR/REC-xml">Extensible Markup Language (XML) 1.0 (Second Edition)</a> 34 * @see <a href="http://www.w3.org/XML/xml-V10-2e-errata">XML 1.0 Second Edition Specification Errata</a> 35 * @see <a href="http://www.w3.org/TR/xml-names11/">Namespaces in XML 1.1</a> 36 * @see <a href="http://www.w3.org/TR/REC-xml-names">Namespaces in XML</a> 37 * @see <a href="http://www.w3.org/XML/xml-names-19990114-errata">Namespaces in XML Errata</a> 38 * @see <a href="http://www.w3.org/TR/xmlschema-1/">XML Schema Part 1: Structures</a> 39 * @since 1.5 40 **/ 41 42 public final class XMLConstants { 43 44 /** 45 * <p>Private constructor to prevent instantiation.</p> 46 */ 47 private XMLConstants() { 48 } 49 50 /** 51 * <p>Namespace URI to use to represent that there is no Namespace.</p> 52 * 53 * <p>Defined by the Namespace specification to be "".</p> 54 * 55 * @see <a href="http://www.w3.org/TR/REC-xml-names/#defaulting"> 56 * Namespaces in XML, 5.2 Namespace Defaulting</a> 57 */ 58 public static final String NULL_NS_URI = ""; 59 60 /** 61 * <p>Prefix to use to represent the default XML Namespace.</p> 62 * 63 * <p>Defined by the XML specification to be "".</p> 64 * 65 * @see <a 66 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> 67 * Namespaces in XML, 3. Qualified Names</a> 68 */ 69 public static final String DEFAULT_NS_PREFIX = ""; 70 71 /** 72 * <p>The official XML Namespace name URI.</p> 73 * 74 * <p>Defined by the XML specification to be 75 * "{@code http://www.w3.org/XML/1998/namespace}".</p> 76 * 77 * @see <a 78 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> 79 * Namespaces in XML, 3. Qualified Names</a> 80 */ 81 public static final String XML_NS_URI = 82 "http://www.w3.org/XML/1998/namespace"; 83 84 /** 85 * <p>The official XML Namespace prefix.</p> 86 * 87 * <p>Defined by the XML specification to be "{@code xml}".</p> 88 * 89 * @see <a 90 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> 91 * Namespaces in XML, 3. Qualified Names<</a> 92 */ 93 public static final String XML_NS_PREFIX = "xml"; 94 95 /** 96 * <p>The official XML attribute used for specifying XML Namespace 97 * declarations, {@link #XMLNS_ATTRIBUTE 98 * XMLConstants.XMLNS_ATTRIBUTE}, Namespace name URI.</p> 99 * 100 * <p>Defined by the XML specification to be 101 * "{@code http://www.w3.org/2000/xmlns/}".</p> 102 * 103 * @see <a 104 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> 105 * Namespaces in XML, 3. Qualified Names</a> 106 * @see <a 107 * href="http://www.w3.org/XML/xml-names-19990114-errata"> 108 * Namespaces in XML Errata</a> 109 */ 110 public static final String XMLNS_ATTRIBUTE_NS_URI = 111 "http://www.w3.org/2000/xmlns/"; 112 113 /** 114 * <p>The official XML attribute used for specifying XML Namespace 115 * declarations.</p> 116 * 117 * <p>It is <strong><em>NOT</em></strong> valid to use as a 118 * prefix. Defined by the XML specification to be 119 * "{@code xmlns}".</p> 120 * 121 * @see <a 122 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> 123 * Namespaces in XML, 3. Qualified Names</a> 124 */ 125 public static final String XMLNS_ATTRIBUTE = "xmlns"; 126 127 /** 128 * <p>W3C XML Schema Namespace URI.</p> 129 * 130 * <p>Defined to be "{@code http://www.w3.org/2001/XMLSchema}". 131 * 132 * @see <a href= 133 * "http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions"> 134 * XML Schema Part 1: 135 * Structures, 2.6 Schema-Related Markup in Documents Being Validated</a> 136 */ 137 public static final String W3C_XML_SCHEMA_NS_URI = 138 "http://www.w3.org/2001/XMLSchema"; 139 140 /** 141 * <p>W3C XML Schema Instance Namespace URI.</p> 142 * 143 * <p>Defined to be "{@code http://www.w3.org/2001/XMLSchema-instance}".</p> 144 * 145 * @see <a href= 146 * "http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions"> 147 * XML Schema Part 1: 148 * Structures, 2.6 Schema-Related Markup in Documents Being Validated</a> 149 */ 150 public static final String W3C_XML_SCHEMA_INSTANCE_NS_URI = 151 "http://www.w3.org/2001/XMLSchema-instance"; 152 153 /** 154 * <p>W3C XPath Datatype Namespace URI.</p> 155 * 156 * <p>Defined to be "{@code http://www.w3.org/2003/11/xpath-datatypes}".</p> 157 * 158 * @see <a href="http://www.w3.org/TR/xpath-datamodel">XQuery 1.0 and XPath 2.0 Data Model</a> 159 */ 160 public static final String W3C_XPATH_DATATYPE_NS_URI = "http://www.w3.org/2003/11/xpath-datatypes"; 161 162 /** 163 * <p>XML Document Type Declaration Namespace URI as an arbitrary value.</p> 164 * 165 * <p>Since not formally defined by any existing standard, arbitrarily define to be "{@code http://www.w3.org/TR/REC-xml}". 166 */ 167 public static final String XML_DTD_NS_URI = "http://www.w3.org/TR/REC-xml"; 168 169 /** 170 * <p>RELAX NG Namespace URI.</p> 171 * 172 * <p>Defined to be "{@code http://relaxng.org/ns/structure/1.0}".</p> 173 * 174 * @see <a href="http://relaxng.org/spec-20011203.html">RELAX NG Specification</a> 175 */ 176 public static final String RELAXNG_NS_URI = "http://relaxng.org/ns/structure/1.0"; 177 178 /** 179 * <p>Feature for secure processing.</p> 180 * 181 * <ul> 182 * <li> 183 * {@code true} instructs the implementation to process XML securely. 184 * This may set limits on XML constructs to avoid conditions such as denial of service attacks. 185 * </li> 186 * <li> 187 * {@code false} instructs the implementation to process XML in accordance with the XML specifications 188 * ignoring security issues such as limits on XML constructs to avoid conditions such as denial of service attacks. 189 * </li> 190 * </ul> 191 */ 192 public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing"; 193 194 195 /** 196 * <p>Property: accessExternalDTD</p> 197 * 198 * <p> 199 * Restrict access to external DTDs and external Entity References to the protocols specified. 200 * If access is denied due to the restriction of this property, a runtime exception that 201 * is specific to the context is thrown. In the case of {@link javax.xml.parsers.SAXParser} 202 * for example, {@link org.xml.sax.SAXException} is thrown. 203 * </p> 204 * 205 * <p> 206 * <b>Value: </b> a list of protocols separated by comma. A protocol is the scheme portion of a 207 * {@link java.net.URI}, or in the case of the JAR protocol, "jar" plus the scheme portion 208 * separated by colon. 209 * A scheme is defined as: 210 * 211 * <blockquote> 212 * scheme = alpha *( alpha | digit | "+" | "-" | "." )<br> 213 * where alpha = a-z and A-Z.<br><br> 214 * 215 * And the JAR protocol:<br> 216 * 217 * jar[:scheme]<br><br> 218 * 219 * Protocols including the keyword "jar" are case-insensitive. Any whitespaces as defined by 220 * {@link java.lang.Character#isSpaceChar } in the value will be ignored. 221 * Examples of protocols are file, http, jar:file. 222 * 223 * </blockquote> 224 *</p> 225 * 226 *<p> 227 * <b>Default value:</b> The default value is implementation specific and therefore not specified. 228 * The following options are provided for consideration: 229 * <blockquote> 230 * <UL> 231 * <LI>an empty string to deny all access to external references;</LI> 232 * <LI>a specific protocol, such as file, to give permission to only the protocol;</LI> 233 * <LI>the keyword "all" to grant permission to all protocols.</LI> 234 *</UL><br> 235 * When FEATURE_SECURE_PROCESSING is enabled, it is recommended that implementations 236 * restrict external connections by default, though this may cause problems for applications 237 * that process XML/XSD/XSL with external references. 238 * </blockquote> 239 * </p> 240 * 241 * <p> 242 * <b>Granting all access:</b> the keyword "all" grants permission to all protocols. 243 * </p> 244 * <p> 245 * <b>System Property:</b> The value of this property can be set or overridden by 246 * system property {@code javax.xml.accessExternalDTD}. 247 * </p> 248 * 249 * <p> 250 * <b>jaxp.properties:</b> This configuration file is in standard 251 * {@link java.util.Properties} format and typically located in the {@code conf} 252 * directory of the Java installation. If the file exists and the system 253 * property is specified, its value will be used to override the default 254 * of the property. 255 * </p> 256 * 257 * <p> 258 * 259 * </p> 260 * @since 1.7 261 */ 262 public static final String ACCESS_EXTERNAL_DTD = "http://javax.xml.XMLConstants/property/accessExternalDTD"; 263 264 /** 265 * <p>Property: accessExternalSchema</p> 266 * 267 * <p> 268 * Restrict access to the protocols specified for external reference set by the 269 * schemaLocation attribute, Import and Include element. If access is denied 270 * due to the restriction of this property, a runtime exception that is specific 271 * to the context is thrown. In the case of {@link javax.xml.validation.SchemaFactory} 272 * for example, org.xml.sax.SAXException is thrown. 273 * </p> 274 * <p> 275 * <b>Value:</b> a list of protocols separated by comma. A protocol is the scheme portion of a 276 * {@link java.net.URI}, or in the case of the JAR protocol, "jar" plus the scheme portion 277 * separated by colon. 278 * A scheme is defined as: 279 * 280 * <blockquote> 281 * scheme = alpha *( alpha | digit | "+" | "-" | "." )<br> 282 * where alpha = a-z and A-Z.<br><br> 283 * 284 * And the JAR protocol:<br> 285 * 286 * jar[:scheme]<br><br> 287 * 288 * Protocols including the keyword "jar" are case-insensitive. Any whitespaces as defined by 289 * {@link java.lang.Character#isSpaceChar } in the value will be ignored. 290 * Examples of protocols are file, http, jar:file. 291 * 292 * </blockquote> 293 *</p> 294 * 295 *<p> 296 * <b>Default value:</b> The default value is implementation specific and therefore not specified. 297 * The following options are provided for consideration: 298 * <blockquote> 299 * <UL> 300 * <LI>an empty string to deny all access to external references;</LI> 301 * <LI>a specific protocol, such as file, to give permission to only the protocol;</LI> 302 * <LI>the keyword "all" to grant permission to all protocols.</LI> 303 *</UL><br> 304 * When FEATURE_SECURE_PROCESSING is enabled, it is recommended that implementations 305 * restrict external connections by default, though this may cause problems for applications 306 * that process XML/XSD/XSL with external references. 307 * </blockquote> 308 * </p> 309 * <p> 310 * <b>Granting all access:</b> the keyword "all" grants permission to all protocols. 311 * </p> 312 * 313 * <p> 314 * <b>System Property:</b> The value of this property can be set or overridden by 315 * system property {@code javax.xml.accessExternalSchema} 316 * </p> 317 * 318 * <p> 319 * <b>jaxp.properties:</b> This configuration file is in standard 320 * {@link java.util.Properties} format and typically located in the {@code conf} 321 * directory of the Java installation. If the file exists and the system 322 * property is specified, its value will be used to override the default 323 * of the property. 324 * 325 * @since 1.7 326 * </p> 327 */ 328 public static final String ACCESS_EXTERNAL_SCHEMA = "http://javax.xml.XMLConstants/property/accessExternalSchema"; 329 330 /** 331 * <p>Property: accessExternalStylesheet</p> 332 * 333 * <p> 334 * Restrict access to the protocols specified for external references set by the 335 * stylesheet processing instruction, Import and Include element, and document function. 336 * If access is denied due to the restriction of this property, a runtime exception 337 * that is specific to the context is thrown. In the case of constructing new 338 * {@link javax.xml.transform.Transformer} for example, 339 * {@link javax.xml.transform.TransformerConfigurationException} 340 * will be thrown by the {@link javax.xml.transform.TransformerFactory}. 341 * </p> 342 * <p> 343 * <b>Value:</b> a list of protocols separated by comma. A protocol is the scheme portion of a 344 * {@link java.net.URI}, or in the case of the JAR protocol, "jar" plus the scheme portion 345 * separated by colon. 346 * A scheme is defined as: 347 * 348 * <blockquote> 349 * scheme = alpha *( alpha | digit | "+" | "-" | "." )<br> 350 * where alpha = a-z and A-Z.<br><br> 351 * 352 * And the JAR protocol:<br> 353 * 354 * jar[:scheme]<br><br> 355 * 356 * Protocols including the keyword "jar" are case-insensitive. Any whitespaces as defined by 357 * {@link java.lang.Character#isSpaceChar } in the value will be ignored. 358 * Examples of protocols are file, http, jar:file. 359 * 360 * </blockquote> 361 *</p> 362 * 363 *<p> 364 * <b>Default value:</b> The default value is implementation specific and therefore not specified. 365 * The following options are provided for consideration: 366 * <blockquote> 367 * <UL> 368 * <LI>an empty string to deny all access to external references;</LI> 369 * <LI>a specific protocol, such as file, to give permission to only the protocol;</LI> 370 * <LI>the keyword "all" to grant permission to all protocols.</LI> 371 *</UL><br> 372 * When FEATURE_SECURE_PROCESSING is enabled, it is recommended that implementations 373 * restrict external connections by default, though this may cause problems for applications 374 * that process XML/XSD/XSL with external references. 375 * </blockquote> 376 * </p> 377 * <p> 378 * <b>Granting all access:</b> the keyword "all" grants permission to all protocols. 379 * </p> 380 * 381 * <p> 382 * <b>System Property:</b> The value of this property can be set or overridden by 383 * system property {@code javax.xml.accessExternalStylesheet} 384 * </p> 385 * 386 * <p> 387 * <b>jaxp.properties:</b> This configuration file is in standard 388 * {@link java.util.Properties} format and typically located in the {@code conf} 389 * directory of the Java installation. If the file exists and the system 390 * property is specified, its value will be used to override the default 391 * of the property. 392 * 393 * @since 1.7 394 */ 395 public static final String ACCESS_EXTERNAL_STYLESHEET = "http://javax.xml.XMLConstants/property/accessExternalStylesheet"; 396 397 } | 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 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). 16 * 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. 20 * 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 23 * questions. 24 */ 25 26 package javax.xml; 27 28 /** 29 * <p>Utility class to contain basic XML values as constants. 30 * 31 * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a> 32 * @see <a href="http://www.w3.org/TR/xml11/">Extensible Markup Language (XML) 1.1</a> 33 * @see <a href="http://www.w3.org/TR/REC-xml">Extensible Markup Language (XML) 1.0 (Second Edition)</a> 34 * @see <a href="http://www.w3.org/XML/xml-V10-2e-errata">XML 1.0 Second Edition Specification Errata</a> 35 * @see <a href="http://www.w3.org/TR/xml-names11/">Namespaces in XML 1.1</a> 36 * @see <a href="http://www.w3.org/TR/REC-xml-names">Namespaces in XML</a> 37 * @see <a href="http://www.w3.org/XML/xml-names-19990114-errata">Namespaces in XML Errata</a> 38 * @see <a href="http://www.w3.org/TR/xmlschema-1/">XML Schema Part 1: Structures</a> 39 * @since 1.5 40 **/ 41 42 public final class XMLConstants { 43 44 /** 45 * Private constructor to prevent instantiation. 46 */ 47 private XMLConstants() { 48 } 49 50 /** 51 * Namespace URI to use to represent that there is no Namespace. 52 * 53 * <p>Defined by the Namespace specification to be "". 54 * 55 * @see <a href="http://www.w3.org/TR/REC-xml-names/#defaulting"> 56 * Namespaces in XML, 5.2 Namespace Defaulting</a> 57 */ 58 public static final String NULL_NS_URI = ""; 59 60 /** 61 * Prefix to use to represent the default XML Namespace. 62 * 63 * <p>Defined by the XML specification to be "". 64 * 65 * @see <a 66 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> 67 * Namespaces in XML, 3. Qualified Names</a> 68 */ 69 public static final String DEFAULT_NS_PREFIX = ""; 70 71 /** 72 * The official XML Namespace name URI. 73 * 74 * <p>Defined by the XML specification to be 75 * "{@code http://www.w3.org/XML/1998/namespace}". 76 * 77 * @see <a 78 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> 79 * Namespaces in XML, 3. Qualified Names</a> 80 */ 81 public static final String XML_NS_URI = 82 "http://www.w3.org/XML/1998/namespace"; 83 84 /** 85 * The official XML Namespace prefix. 86 * 87 * <p>Defined by the XML specification to be "{@code xml}". 88 * 89 * @see <a 90 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> 91 * Namespaces in XML, 3. Qualified Names</a> 92 */ 93 public static final String XML_NS_PREFIX = "xml"; 94 95 /** 96 * The official XML attribute used for specifying XML Namespace 97 * declarations, {@link #XMLNS_ATTRIBUTE 98 * XMLConstants.XMLNS_ATTRIBUTE}, Namespace name URI. 99 * 100 * <p>Defined by the XML specification to be 101 * "{@code http://www.w3.org/2000/xmlns/}". 102 * 103 * @see <a 104 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> 105 * Namespaces in XML, 3. Qualified Names</a> 106 * @see <a 107 * href="http://www.w3.org/XML/xml-names-19990114-errata"> 108 * Namespaces in XML Errata</a> 109 */ 110 public static final String XMLNS_ATTRIBUTE_NS_URI = 111 "http://www.w3.org/2000/xmlns/"; 112 113 /** 114 * The official XML attribute used for specifying XML Namespace 115 * declarations. 116 * 117 * <p>It is <strong><em>NOT</em></strong> valid to use as a 118 * prefix. Defined by the XML specification to be 119 * "{@code xmlns}". 120 * 121 * @see <a 122 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> 123 * Namespaces in XML, 3. Qualified Names</a> 124 */ 125 public static final String XMLNS_ATTRIBUTE = "xmlns"; 126 127 /** 128 * W3C XML Schema Namespace URI. 129 * 130 * <p>Defined to be "{@code http://www.w3.org/2001/XMLSchema}". 131 * 132 * @see <a href= 133 * "http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions"> 134 * XML Schema Part 1: 135 * Structures, 2.6 Schema-Related Markup in Documents Being Validated</a> 136 */ 137 public static final String W3C_XML_SCHEMA_NS_URI = 138 "http://www.w3.org/2001/XMLSchema"; 139 140 /** 141 * W3C XML Schema Instance Namespace URI. 142 * 143 * <p>Defined to be "{@code http://www.w3.org/2001/XMLSchema-instance}". 144 * 145 * @see <a href= 146 * "http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions"> 147 * XML Schema Part 1: 148 * Structures, 2.6 Schema-Related Markup in Documents Being Validated</a> 149 */ 150 public static final String W3C_XML_SCHEMA_INSTANCE_NS_URI = 151 "http://www.w3.org/2001/XMLSchema-instance"; 152 153 /** 154 * W3C XPath Datatype Namespace URI. 155 * 156 * <p>Defined to be "{@code http://www.w3.org/2003/11/xpath-datatypes}". 157 * 158 * @see <a href="http://www.w3.org/TR/xpath-datamodel">XQuery 1.0 and XPath 2.0 Data Model</a> 159 */ 160 public static final String W3C_XPATH_DATATYPE_NS_URI = "http://www.w3.org/2003/11/xpath-datatypes"; 161 162 /** 163 * XML Document Type Declaration Namespace URI as an arbitrary value. 164 * 165 * <p>Since not formally defined by any existing standard, arbitrarily define to be "{@code http://www.w3.org/TR/REC-xml}". 166 */ 167 public static final String XML_DTD_NS_URI = "http://www.w3.org/TR/REC-xml"; 168 169 /** 170 * RELAX NG Namespace URI. 171 * 172 * <p>Defined to be "{@code http://relaxng.org/ns/structure/1.0}". 173 * 174 * @see <a href="http://relaxng.org/spec-20011203.html">RELAX NG Specification</a> 175 */ 176 public static final String RELAXNG_NS_URI = "http://relaxng.org/ns/structure/1.0"; 177 178 /** 179 * Feature for secure processing. 180 * 181 * <ul> 182 * <li> 183 * {@code true} instructs the implementation to process XML securely. 184 * This may set limits on XML constructs to avoid conditions such as denial of service attacks. 185 * </li> 186 * <li> 187 * {@code false} instructs the implementation to process XML in accordance with the XML specifications 188 * ignoring security issues such as limits on XML constructs to avoid conditions such as denial of service attacks. 189 * </li> 190 * </ul> 191 */ 192 public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing"; 193 194 195 /** 196 * Property: accessExternalDTD 197 * 198 * <p> 199 * Restrict access to external DTDs and external Entity References to the protocols specified. 200 * If access is denied due to the restriction of this property, a runtime exception that 201 * is specific to the context is thrown. In the case of {@link javax.xml.parsers.SAXParser} 202 * for example, {@link org.xml.sax.SAXException} is thrown. 203 * 204 * <p> 205 * <b>Value: </b> a list of protocols separated by comma. A protocol is the scheme portion of a 206 * {@link java.net.URI}, or in the case of the JAR protocol, "jar" plus the scheme portion 207 * separated by colon. 208 * A scheme is defined as: 209 * 210 * <blockquote> 211 * scheme = alpha *( alpha | digit | "+" | "-" | "." )<br> 212 * where alpha = a-z and A-Z.<br><br> 213 * 214 * And the JAR protocol:<br> 215 * 216 * jar[:scheme]<br><br> 217 * 218 * Protocols including the keyword "jar" are case-insensitive. Any whitespaces as defined by 219 * {@link java.lang.Character#isSpaceChar } in the value will be ignored. 220 * Examples of protocols are file, http, jar:file. 221 * 222 * </blockquote> 223 * 224 *<p> 225 * <b>Default value:</b> The default value is implementation specific and therefore not specified. 226 * The following options are provided for consideration: 227 * <blockquote> 228 * <UL> 229 * <LI>an empty string to deny all access to external references;</LI> 230 * <LI>a specific protocol, such as file, to give permission to only the protocol;</LI> 231 * <LI>the keyword "all" to grant permission to all protocols.</LI> 232 * </UL><br> 233 * When FEATURE_SECURE_PROCESSING is enabled, it is recommended that implementations 234 * restrict external connections by default, though this may cause problems for applications 235 * that process XML/XSD/XSL with external references. 236 * </blockquote> 237 * 238 * <p> 239 * <b>Granting all access:</b> the keyword "all" grants permission to all protocols. 240 * 241 * <p> 242 * <b>System Property:</b> The value of this property can be set or overridden by 243 * system property {@code javax.xml.accessExternalDTD}. 244 * 245 * 246 * <p> 247 * <b>jaxp.properties:</b> This configuration file is in standard 248 * {@link java.util.Properties} format and typically located in the {@code conf} 249 * directory of the Java installation. If the file exists and the system 250 * property is specified, its value will be used to override the default 251 * of the property. 252 * 253 * 254 * @since 1.7 255 */ 256 public static final String ACCESS_EXTERNAL_DTD = "http://javax.xml.XMLConstants/property/accessExternalDTD"; 257 258 /** 259 * <p>Property: accessExternalSchema</p> 260 * 261 * <p> 262 * Restrict access to the protocols specified for external reference set by the 263 * schemaLocation attribute, Import and Include element. If access is denied 264 * due to the restriction of this property, a runtime exception that is specific 265 * to the context is thrown. In the case of {@link javax.xml.validation.SchemaFactory} 266 * for example, org.xml.sax.SAXException is thrown. 267 * 268 * <p> 269 * <b>Value:</b> a list of protocols separated by comma. A protocol is the scheme portion of a 270 * {@link java.net.URI}, or in the case of the JAR protocol, "jar" plus the scheme portion 271 * separated by colon. 272 * A scheme is defined as: 273 * 274 * <blockquote> 275 * scheme = alpha *( alpha | digit | "+" | "-" | "." )<br> 276 * where alpha = a-z and A-Z.<br><br> 277 * 278 * And the JAR protocol:<br> 279 * 280 * jar[:scheme]<br><br> 281 * 282 * Protocols including the keyword "jar" are case-insensitive. Any whitespaces as defined by 283 * {@link java.lang.Character#isSpaceChar } in the value will be ignored. 284 * Examples of protocols are file, http, jar:file. 285 * 286 * </blockquote> 287 * 288 * <p> 289 * <b>Default value:</b> The default value is implementation specific and therefore not specified. 290 * The following options are provided for consideration: 291 * <blockquote> 292 * <UL> 293 * <LI>an empty string to deny all access to external references;</LI> 294 * <LI>a specific protocol, such as file, to give permission to only the protocol;</LI> 295 * <LI>the keyword "all" to grant permission to all protocols.</LI> 296 * </UL><br> 297 * When FEATURE_SECURE_PROCESSING is enabled, it is recommended that implementations 298 * restrict external connections by default, though this may cause problems for applications 299 * that process XML/XSD/XSL with external references. 300 * </blockquote> 301 * 302 * <p> 303 * <b>Granting all access:</b> the keyword "all" grants permission to all protocols. 304 * 305 * <p> 306 * <b>System Property:</b> The value of this property can be set or overridden by 307 * system property {@code javax.xml.accessExternalSchema} 308 * 309 * <p> 310 * <b>jaxp.properties:</b> This configuration file is in standard 311 * {@link java.util.Properties} format and typically located in the {@code conf} 312 * directory of the Java installation. If the file exists and the system 313 * property is specified, its value will be used to override the default 314 * of the property. 315 * 316 * @since 1.7 317 */ 318 public static final String ACCESS_EXTERNAL_SCHEMA = "http://javax.xml.XMLConstants/property/accessExternalSchema"; 319 320 /** 321 * Property: accessExternalStylesheet 322 * 323 * <p> 324 * Restrict access to the protocols specified for external references set by the 325 * stylesheet processing instruction, Import and Include element, and document function. 326 * If access is denied due to the restriction of this property, a runtime exception 327 * that is specific to the context is thrown. In the case of constructing new 328 * {@link javax.xml.transform.Transformer} for example, 329 * {@link javax.xml.transform.TransformerConfigurationException} 330 * will be thrown by the {@link javax.xml.transform.TransformerFactory}. 331 * 332 * <p> 333 * <b>Value:</b> a list of protocols separated by comma. A protocol is the scheme portion of a 334 * {@link java.net.URI}, or in the case of the JAR protocol, "jar" plus the scheme portion 335 * separated by colon. 336 * A scheme is defined as: 337 * 338 * <blockquote> 339 * scheme = alpha *( alpha | digit | "+" | "-" | "." )<br> 340 * where alpha = a-z and A-Z.<br><br> 341 * 342 * And the JAR protocol:<br> 343 * 344 * jar[:scheme]<br><br> 345 * 346 * Protocols including the keyword "jar" are case-insensitive. Any whitespaces as defined by 347 * {@link java.lang.Character#isSpaceChar } in the value will be ignored. 348 * Examples of protocols are file, http, jar:file. 349 * 350 * </blockquote> 351 * 352 * <p> 353 * <b>Default value:</b> The default value is implementation specific and therefore not specified. 354 * The following options are provided for consideration: 355 * <blockquote> 356 * <UL> 357 * <LI>an empty string to deny all access to external references;</LI> 358 * <LI>a specific protocol, such as file, to give permission to only the protocol;</LI> 359 * <LI>the keyword "all" to grant permission to all protocols.</LI> 360 * </UL><br> 361 * When FEATURE_SECURE_PROCESSING is enabled, it is recommended that implementations 362 * restrict external connections by default, though this may cause problems for applications 363 * that process XML/XSD/XSL with external references. 364 * </blockquote> 365 * 366 * <p> 367 * <b>Granting all access:</b> the keyword "all" grants permission to all protocols. 368 * 369 * <p> 370 * <b>System Property:</b> The value of this property can be set or overridden by 371 * system property {@code javax.xml.accessExternalStylesheet} 372 * 373 * <p> 374 * <b>jaxp.properties:</b> This configuration file is in standard 375 * {@link java.util.Properties} format and typically located in the {@code conf} 376 * directory of the Java installation. If the file exists and the system 377 * property is specified, its value will be used to override the default 378 * of the property. 379 * 380 * @since 1.7 381 */ 382 public static final String ACCESS_EXTERNAL_STYLESHEET = "http://javax.xml.XMLConstants/property/accessExternalStylesheet"; 383 384 } |