|
1 /* |
|
2 * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. |
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 * |
|
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. |
|
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 * @version $Revision: 1.8 $, $Date: 2010/05/25 16:19:45 $ |
|
33 * @see <a href="http://www.w3.org/TR/xml11/">Extensible Markup Language (XML) 1.1</a> |
|
34 * @see <a href="http://www.w3.org/TR/REC-xml">Extensible Markup Language (XML) 1.0 (Second Edition)</a> |
|
35 * @see <a href="http://www.w3.org/XML/xml-V10-2e-errata">XML 1.0 Second Edition Specification Errata</a> |
|
36 * @see <a href="http://www.w3.org/TR/xml-names11/">Namespaces in XML 1.1</a> |
|
37 * @see <a href="http://www.w3.org/TR/REC-xml-names">Namespaces in XML</a> |
|
38 * @see <a href="http://www.w3.org/XML/xml-names-19990114-errata">Namespaces in XML Errata</a> |
|
39 * @see <a href="http://www.w3.org/TR/xmlschema-1/">XML Schema Part 1: Structures</a> |
|
40 * @since 1.5 |
|
41 **/ |
|
42 |
|
43 public final class XMLConstants { |
|
44 |
|
45 /** |
|
46 * <p>Private constructor to prevent instantiation.</p> |
|
47 */ |
|
48 private XMLConstants() { |
|
49 } |
|
50 |
|
51 /** |
|
52 * <p>Namespace URI to use to represent that there is no Namespace.</p> |
|
53 * |
|
54 * <p>Defined by the Namespace specification to be "".</p> |
|
55 * |
|
56 * @see <a href="http://www.w3.org/TR/REC-xml-names/#defaulting"> |
|
57 * Namespaces in XML, 5.2 Namespace Defaulting</a> |
|
58 */ |
|
59 public static final String NULL_NS_URI = ""; |
|
60 |
|
61 /** |
|
62 * <p>Prefix to use to represent the default XML Namespace.</p> |
|
63 * |
|
64 * <p>Defined by the XML specification to be "".</p> |
|
65 * |
|
66 * @see <a |
|
67 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> |
|
68 * Namespaces in XML, 3. Qualified Names</a> |
|
69 */ |
|
70 public static final String DEFAULT_NS_PREFIX = ""; |
|
71 |
|
72 /** |
|
73 * <p>The official XML Namespace name URI.</p> |
|
74 * |
|
75 * <p>Defined by the XML specification to be |
|
76 * "<code>http://www.w3.org/XML/1998/namespace</code>".</p> |
|
77 * |
|
78 * @see <a |
|
79 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> |
|
80 * Namespaces in XML, 3. Qualified Names</a> |
|
81 */ |
|
82 public static final String XML_NS_URI = |
|
83 "http://www.w3.org/XML/1998/namespace"; |
|
84 |
|
85 /** |
|
86 * <p>The official XML Namespace prefix.</p> |
|
87 * |
|
88 * <p>Defined by the XML specification to be "<code>xml</code>".</p> |
|
89 * |
|
90 * @see <a |
|
91 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> |
|
92 * Namespaces in XML, 3. Qualified Names<</a> |
|
93 */ |
|
94 public static final String XML_NS_PREFIX = "xml"; |
|
95 |
|
96 /** |
|
97 * <p>The official XML attribute used for specifying XML Namespace |
|
98 * declarations, {@link #XMLNS_ATTRIBUTE |
|
99 * XMLConstants.XMLNS_ATTRIBUTE}, Namespace name URI.</p> |
|
100 * |
|
101 * <p>Defined by the XML specification to be |
|
102 * "<code>http://www.w3.org/2000/xmlns/</code>".</p> |
|
103 * |
|
104 * @see <a |
|
105 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> |
|
106 * Namespaces in XML, 3. Qualified Names</a> |
|
107 * @see <a |
|
108 * href="http://www.w3.org/XML/xml-names-19990114-errata"> |
|
109 * Namespaces in XML Errata</a> |
|
110 */ |
|
111 public static final String XMLNS_ATTRIBUTE_NS_URI = |
|
112 "http://www.w3.org/2000/xmlns/"; |
|
113 |
|
114 /** |
|
115 * <p>The official XML attribute used for specifying XML Namespace |
|
116 * declarations.</p> |
|
117 * |
|
118 * <p>It is <strong><em>NOT</em></strong> valid to use as a |
|
119 * prefix. Defined by the XML specification to be |
|
120 * "<code>xmlns</code>".</p> |
|
121 * |
|
122 * @see <a |
|
123 * href="http://www.w3.org/TR/REC-xml-names/#ns-qualnames"> |
|
124 * Namespaces in XML, 3. Qualified Names</a> |
|
125 */ |
|
126 public static final String XMLNS_ATTRIBUTE = "xmlns"; |
|
127 |
|
128 /** |
|
129 * <p>W3C XML Schema Namespace URI.</p> |
|
130 * |
|
131 * <p>Defined to be "<code>http://www.w3.org/2001/XMLSchema</code>". |
|
132 * |
|
133 * @see <a href= |
|
134 * "http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions"> |
|
135 * XML Schema Part 1: |
|
136 * Structures, 2.6 Schema-Related Markup in Documents Being Validated</a> |
|
137 */ |
|
138 public static final String W3C_XML_SCHEMA_NS_URI = |
|
139 "http://www.w3.org/2001/XMLSchema"; |
|
140 |
|
141 /** |
|
142 * <p>W3C XML Schema Instance Namespace URI.</p> |
|
143 * |
|
144 * <p>Defined to be "<code>http://www.w3.org/2001/XMLSchema-instance</code>".</p> |
|
145 * |
|
146 * @see <a href= |
|
147 * "http://www.w3.org/TR/xmlschema-1/#Instance_Document_Constructions"> |
|
148 * XML Schema Part 1: |
|
149 * Structures, 2.6 Schema-Related Markup in Documents Being Validated</a> |
|
150 */ |
|
151 public static final String W3C_XML_SCHEMA_INSTANCE_NS_URI = |
|
152 "http://www.w3.org/2001/XMLSchema-instance"; |
|
153 |
|
154 /** |
|
155 * <p>W3C XPath Datatype Namespace URI.</p> |
|
156 * |
|
157 * <p>Defined to be "<code>http://www.w3.org/2003/11/xpath-datatypes</code>".</p> |
|
158 * |
|
159 * @see <a href="http://www.w3.org/TR/xpath-datamodel">XQuery 1.0 and XPath 2.0 Data Model</a> |
|
160 */ |
|
161 public static final String W3C_XPATH_DATATYPE_NS_URI = "http://www.w3.org/2003/11/xpath-datatypes"; |
|
162 |
|
163 /** |
|
164 * <p>XML Document Type Declaration Namespace URI as an arbitrary value.</p> |
|
165 * |
|
166 * <p>Since not formally defined by any existing standard, arbitrarily define to be "<code>http://www.w3.org/TR/REC-xml</code>". |
|
167 */ |
|
168 public static final String XML_DTD_NS_URI = "http://www.w3.org/TR/REC-xml"; |
|
169 |
|
170 /** |
|
171 * <p>RELAX NG Namespace URI.</p> |
|
172 * |
|
173 * <p>Defined to be "<code>http://relaxng.org/ns/structure/1.0</code>".</p> |
|
174 * |
|
175 * @see <a href="http://relaxng.org/spec-20011203.html">RELAX NG Specification</a> |
|
176 */ |
|
177 public static final String RELAXNG_NS_URI = "http://relaxng.org/ns/structure/1.0"; |
|
178 |
|
179 /** |
|
180 * <p>Feature for secure processing.</p> |
|
181 * |
|
182 * <ul> |
|
183 * <li> |
|
184 * <code>true</code> instructs the implementation to process XML securely. |
|
185 * This may set limits on XML constructs to avoid conditions such as denial of service attacks. |
|
186 * </li> |
|
187 * <li> |
|
188 * <code>false</code> instructs the implementation to process XML acording the letter of the XML specifications |
|
189 * ingoring security issues such as limits on XML constructs to avoid conditions such as denial of service attacks. |
|
190 * </li> |
|
191 * </ul> |
|
192 */ |
|
193 public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing"; |
|
194 } |