author | joehw |
Wed, 04 Oct 2017 10:54:18 -0700 | |
changeset 47312 | d4f959806fe9 |
parent 47216 | 71c04702a3d5 |
child 47359 | e1a6c0168741 |
permissions | -rw-r--r-- |
27111
7a491d709b83
8036951: Xerces Update: XMLSchemaValidator.java and XMLSchemaLoader.java
joehw
parents:
26257
diff
changeset
|
1 |
/* |
47312 | 2 |
* Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. |
3 |
* @LastModified: Sep 2017 |
|
27111
7a491d709b83
8036951: Xerces Update: XMLSchemaValidator.java and XMLSchemaLoader.java
joehw
parents:
26257
diff
changeset
|
4 |
*/ |
12005 | 5 |
/* |
26257
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
6 |
* Licensed to the Apache Software Foundation (ASF) under one or more |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
7 |
* contributor license agreements. See the NOTICE file distributed with |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
8 |
* this work for additional information regarding copyright ownership. |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
9 |
* The ASF licenses this file to You under the Apache License, Version 2.0 |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
10 |
* (the "License"); you may not use this file except in compliance with |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
11 |
* the License. You may obtain a copy of the License at |
12005 | 12 |
* |
13 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
14 |
* |
|
15 |
* Unless required by applicable law or agreed to in writing, software |
|
16 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
17 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
18 |
* See the License for the specific language governing permissions and |
|
19 |
* limitations under the License. |
|
20 |
*/ |
|
21 |
||
22 |
package com.sun.org.apache.xerces.internal.impl; |
|
23 |
||
24 |
import java.util.Enumeration; |
|
25 |
import java.util.NoSuchElementException; |
|
47312 | 26 |
import jdk.xml.internal.SecuritySupport; |
12005 | 27 |
|
28 |
/** |
|
29 |
* Commonly used constants. |
|
30 |
* |
|
31 |
* @xerces.internal |
|
32 |
* |
|
33 |
* @author Andy Clark, IBM |
|
34 |
* |
|
35 |
*/ |
|
36 |
public final class Constants { |
|
37 |
||
38 |
// |
|
39 |
// Constants |
|
40 |
// |
|
41 |
// Schema Types: |
|
42 |
public static final String NS_XMLSCHEMA = "http://www.w3.org/2001/XMLSchema".intern(); |
|
43 |
public static final String NS_DTD = "http://www.w3.org/TR/REC-xml".intern(); |
|
44 |
||
26257
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
45 |
// Schema Versions: |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
46 |
public static final String W3C_XML_SCHEMA10_NS_URI = "http://www.w3.org/XML/XMLSchema/v1.0".intern(); |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
47 |
|
12005 | 48 |
// Schema features |
49 |
public static final String SUN_SCHEMA_FEATURE_PREFIX = "http://java.sun.com/xml/schema/features/"; |
|
50 |
public static final String SUN_REPORT_IGNORED_ELEMENT_CONTENT_WHITESPACE = "report-ignored-element-content-whitespace"; |
|
51 |
||
52 |
//stax properties |
|
53 |
||
54 |
public static final String ZEPHYR_PROPERTY_PREFIX = "http://java.sun.com/xml/stream/properties/" ; |
|
55 |
public static final String STAX_PROPERTIES = "stax-properties" ; |
|
56 |
public static final String STAX_ENTITY_RESOLVER_PROPERTY = "internal/stax-entity-resolver"; |
|
57 |
public static final String STAX_REPORT_CDATA_EVENT = "report-cdata-event"; |
|
58 |
public static final String READER_IN_DEFINED_STATE = ZEPHYR_PROPERTY_PREFIX + "reader-in-defined-state" ; |
|
59 |
public static final String ADD_NAMESPACE_DECL_AS_ATTRIBUTE = "add-namespacedecl-as-attrbiute"; |
|
60 |
public static final String ESCAPE_CHARACTERS = "escapeCharacters"; |
|
61 |
public static final String REUSE_INSTANCE = "reuse-instance" ; |
|
62 |
||
63 |
//DOM properties |
|
64 |
public static final String SUN_DOM_PROPERTY_PREFIX = "http://java.sun.com/xml/dom/properties/" ; |
|
65 |
public static final String SUN_DOM_ANCESTOR_CHECCK = "ancestor-check"; |
|
66 |
||
67 |
/** |
|
68 |
* If true, ignore DOCTYPE declaration as if it wasn't present at all. |
|
69 |
* Note that this is a violation of the XML recommendation. |
|
70 |
* The full property name is prefixed by {@link #ZEPHYR_PROPERTY_PREFIX}. |
|
71 |
*/ |
|
72 |
public static final String IGNORE_EXTERNAL_DTD = "ignore-external-dtd"; |
|
73 |
||
74 |
// sax features |
|
75 |
||
76 |
/** SAX feature prefix ("http://xml.org/sax/features/"). */ |
|
77 |
public static final String SAX_FEATURE_PREFIX = "http://xml.org/sax/features/"; |
|
78 |
||
79 |
public static final String NAMESPACES_FEATURE = "namespaces"; |
|
80 |
||
81 |
/** Namespace prefixes feature ("namespace-prefixes"). */ |
|
82 |
public static final String NAMESPACE_PREFIXES_FEATURE = "namespace-prefixes"; |
|
83 |
||
84 |
/** String interning feature ("string-interning"). */ |
|
85 |
public static final String STRING_INTERNING_FEATURE = "string-interning"; |
|
86 |
||
87 |
/** Validation feature ("validation"). */ |
|
88 |
public static final String VALIDATION_FEATURE = "validation"; |
|
89 |
||
90 |
/** External general entities feature ("external-general-entities "). */ |
|
91 |
public static final String EXTERNAL_GENERAL_ENTITIES_FEATURE = "external-general-entities"; |
|
92 |
||
93 |
/** External parameter entities feature ("external-parameter-entities "). */ |
|
94 |
public static final String EXTERNAL_PARAMETER_ENTITIES_FEATURE = "external-parameter-entities"; |
|
95 |
||
96 |
/** Lexical handler parameter entities feature ("lexical-handler/parameter-entities"). */ |
|
97 |
public static final String LEXICAL_HANDLER_PARAMETER_ENTITIES_FEATURE = "lexical-handler/parameter-entities"; |
|
98 |
||
99 |
/** Is standalone feature ("is-standalone"). */ |
|
100 |
public static final String IS_STANDALONE_FEATURE = "is-standalone"; |
|
101 |
||
102 |
/** Resolve DTD URIs feature ("resolve-dtd-uris"). */ |
|
103 |
public static final String RESOLVE_DTD_URIS_FEATURE = "resolve-dtd-uris"; |
|
104 |
||
105 |
/** Use Attributes2 feature ("use-attributes2"). */ |
|
106 |
public static final String USE_ATTRIBUTES2_FEATURE = "use-attributes2"; |
|
107 |
||
108 |
/** Use Locator2 feature ("use-locator2"). */ |
|
109 |
public static final String USE_LOCATOR2_FEATURE = "use-locator2"; |
|
110 |
||
111 |
/** Use EntityResolver2 feature ("use-entity-resolver2"). */ |
|
112 |
public static final String USE_ENTITY_RESOLVER2_FEATURE = "use-entity-resolver2"; |
|
113 |
||
114 |
/** Unicode normalization checking feature ("unicode-normalization-checking"). */ |
|
115 |
public static final String UNICODE_NORMALIZATION_CHECKING_FEATURE = "unicode-normalization-checking"; |
|
116 |
||
117 |
/** xmlns URIs feature ("xmlns-uris"). */ |
|
118 |
public static final String XMLNS_URIS_FEATURE = "xmlns-uris"; |
|
119 |
||
120 |
/** XML 1.1 feature ("xml-1.1"). */ |
|
121 |
public static final String XML_11_FEATURE = "xml-1.1"; |
|
122 |
||
123 |
/** Allow unparsed entity and notation declaration events to be sent after the end DTD event ("allow-dtd-events-after-endDTD") */ |
|
124 |
public static final String ALLOW_DTD_EVENTS_AFTER_ENDDTD_FEATURE = "allow-dtd-events-after-endDTD"; |
|
125 |
||
126 |
// sax properties |
|
127 |
||
128 |
/** SAX property prefix ("http://xml.org/sax/properties/"). */ |
|
129 |
public static final String SAX_PROPERTY_PREFIX = "http://xml.org/sax/properties/"; |
|
130 |
||
131 |
/** Declaration handler property ("declaration-handler"). */ |
|
132 |
public static final String DECLARATION_HANDLER_PROPERTY = "declaration-handler"; |
|
133 |
||
134 |
/** Lexical handler property ("lexical-handler"). */ |
|
135 |
public static final String LEXICAL_HANDLER_PROPERTY = "lexical-handler"; |
|
136 |
||
137 |
/** DOM node property ("dom-node"). */ |
|
138 |
public static final String DOM_NODE_PROPERTY = "dom-node"; |
|
139 |
||
140 |
/** XML string property ("xml-string"). */ |
|
141 |
public static final String XML_STRING_PROPERTY = "xml-string"; |
|
142 |
||
12458 | 143 |
public static final String FEATURE_SECURE_PROCESSING = "http://javax.xml.XMLConstants/feature/secure-processing"; |
144 |
||
17534 | 145 |
// Oracle Feature: |
146 |
/** |
|
147 |
* <p>Use Service Mechanism</p> |
|
148 |
* |
|
149 |
* <ul> |
|
150 |
* <li> |
|
151 |
* {@code true} instruct an object to use service mechanism to |
|
152 |
* find a service implementation. This is the default behavior. |
|
153 |
* </li> |
|
154 |
* <li> |
|
155 |
* {@code false} instruct an object to skip service mechanism and |
|
156 |
* use the default implementation for that service. |
|
157 |
* </li> |
|
158 |
* </ul> |
|
159 |
*/ |
|
12458 | 160 |
public static final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism"; |
12005 | 161 |
|
162 |
/** Document XML version property ("document-xml-version"). */ |
|
163 |
public static final String DOCUMENT_XML_VERSION_PROPERTY = "document-xml-version"; |
|
164 |
||
165 |
||
166 |
// |
|
167 |
// JAXP properties |
|
168 |
// |
|
169 |
||
170 |
/** JAXP property prefix ("http://java.sun.com/xml/jaxp/properties/"). */ |
|
171 |
public static final String JAXP_PROPERTY_PREFIX = |
|
172 |
"http://java.sun.com/xml/jaxp/properties/"; |
|
173 |
||
174 |
/** JAXP schemaSource property: when used internally may include DTD sources (DOM) */ |
|
175 |
public static final String SCHEMA_SOURCE = "schemaSource"; |
|
176 |
||
177 |
/** JAXP schemaSource language: when used internally may include DTD namespace (DOM) */ |
|
178 |
public static final String SCHEMA_LANGUAGE = "schemaLanguage"; |
|
179 |
||
17534 | 180 |
/** JAXP Standard property prefix ("http://javax.xml.XMLConstants/property/"). */ |
181 |
public static final String JAXPAPI_PROPERTY_PREFIX = |
|
182 |
"http://javax.xml.XMLConstants/property/"; |
|
183 |
||
184 |
/** Oracle JAXP property prefix ("http://www.oracle.com/xml/jaxp/properties/"). */ |
|
185 |
public static final String ORACLE_JAXP_PROPERTY_PREFIX = |
|
186 |
"http://www.oracle.com/xml/jaxp/properties/"; |
|
187 |
||
18890
25bdeca3173b
8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown
joehw
parents:
17991
diff
changeset
|
188 |
public static final String XML_SECURITY_PROPERTY_MANAGER = |
25bdeca3173b
8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown
joehw
parents:
17991
diff
changeset
|
189 |
ORACLE_JAXP_PROPERTY_PREFIX + "xmlSecurityPropertyManager"; |
25bdeca3173b
8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown
joehw
parents:
17991
diff
changeset
|
190 |
|
17534 | 191 |
//System Properties corresponding to ACCESS_EXTERNAL_* properties |
192 |
public static final String SP_ACCESS_EXTERNAL_DTD = "javax.xml.accessExternalDTD"; |
|
193 |
public static final String SP_ACCESS_EXTERNAL_SCHEMA = "javax.xml.accessExternalSchema"; |
|
194 |
//all access keyword |
|
195 |
public static final String ACCESS_EXTERNAL_ALL = "all"; |
|
196 |
||
197 |
/** |
|
198 |
* Default value when FEATURE_SECURE_PROCESSING (FSP) is set to true |
|
199 |
*/ |
|
200 |
public static final String EXTERNAL_ACCESS_DEFAULT_FSP = ""; |
|
201 |
||
202 |
/** |
|
203 |
* FEATURE_SECURE_PROCESSING (FSP) is true by default |
|
204 |
*/ |
|
17991
4a8c5120a8d4
8015630: Remove default restriction settings of jaxp 1.5 properties in JDK8
joehw
parents:
17534
diff
changeset
|
205 |
public static final String EXTERNAL_ACCESS_DEFAULT = ACCESS_EXTERNAL_ALL; |
17534 | 206 |
|
12005 | 207 |
// |
20968 | 208 |
// Implementation limits: corresponding System Properties of the above |
209 |
// API properties |
|
210 |
// |
|
211 |
/** |
|
212 |
* JDK entity expansion limit; Note that the existing system property |
|
213 |
* "entityExpansionLimit" with no prefix is still observed |
|
214 |
*/ |
|
215 |
public static final String JDK_ENTITY_EXPANSION_LIMIT = |
|
216 |
ORACLE_JAXP_PROPERTY_PREFIX + "entityExpansionLimit"; |
|
217 |
||
218 |
/** |
|
219 |
* JDK element attribute limit; Note that the existing system property |
|
220 |
* "elementAttributeLimit" with no prefix is still observed |
|
221 |
*/ |
|
222 |
public static final String JDK_ELEMENT_ATTRIBUTE_LIMIT = |
|
223 |
ORACLE_JAXP_PROPERTY_PREFIX + "elementAttributeLimit"; |
|
224 |
||
225 |
/** |
|
226 |
* JDK maxOccur limit; Note that the existing system property |
|
227 |
* "maxOccurLimit" with no prefix is still observed |
|
228 |
*/ |
|
229 |
public static final String JDK_MAX_OCCUR_LIMIT = |
|
230 |
ORACLE_JAXP_PROPERTY_PREFIX + "maxOccurLimit"; |
|
231 |
||
232 |
/** |
|
233 |
* JDK total entity size limit |
|
234 |
*/ |
|
235 |
public static final String JDK_TOTAL_ENTITY_SIZE_LIMIT = |
|
236 |
ORACLE_JAXP_PROPERTY_PREFIX + "totalEntitySizeLimit"; |
|
237 |
||
238 |
/** |
|
239 |
* JDK maximum general entity size limit |
|
240 |
*/ |
|
22418
1ee8fd0184d1
8028111: XML readers share the same entity expansion counter
joehw
parents:
22139
diff
changeset
|
241 |
public static final String JDK_GENERAL_ENTITY_SIZE_LIMIT = |
20968 | 242 |
ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit"; |
39799 | 243 |
|
244 |
/** |
|
245 |
* JDK node count limit in entities that limits the total number of nodes |
|
246 |
* in all of entity references. |
|
247 |
*/ |
|
248 |
public static final String JDK_ENTITY_REPLACEMENT_LIMIT = |
|
249 |
ORACLE_JAXP_PROPERTY_PREFIX + "entityReplacementLimit"; |
|
250 |
||
20968 | 251 |
/** |
252 |
* JDK maximum parameter entity size limit |
|
253 |
*/ |
|
254 |
public static final String JDK_PARAMETER_ENTITY_SIZE_LIMIT = |
|
255 |
ORACLE_JAXP_PROPERTY_PREFIX + "maxParameterEntitySizeLimit"; |
|
256 |
/** |
|
257 |
* JDK maximum XML name limit |
|
258 |
*/ |
|
259 |
public static final String JDK_XML_NAME_LIMIT = |
|
260 |
ORACLE_JAXP_PROPERTY_PREFIX + "maxXMLNameLimit"; |
|
25591 | 261 |
|
262 |
/** |
|
263 |
* JDK maxElementDepth limit |
|
264 |
*/ |
|
265 |
public static final String JDK_MAX_ELEMENT_DEPTH = |
|
266 |
ORACLE_JAXP_PROPERTY_PREFIX + "maxElementDepth"; |
|
267 |
||
20968 | 268 |
/** |
269 |
* JDK property to allow printing out information from the limit analyzer |
|
270 |
*/ |
|
271 |
public static final String JDK_ENTITY_COUNT_INFO = |
|
272 |
ORACLE_JAXP_PROPERTY_PREFIX + "getEntityCountInfo"; |
|
273 |
||
274 |
// |
|
275 |
// Implementation limits: API properties |
|
276 |
// |
|
277 |
/** |
|
278 |
* JDK entity expansion limit; Note that the existing system property |
|
279 |
* "entityExpansionLimit" with no prefix is still observed |
|
280 |
*/ |
|
281 |
public static final String SP_ENTITY_EXPANSION_LIMIT = "jdk.xml.entityExpansionLimit"; |
|
282 |
||
283 |
/** |
|
284 |
* JDK element attribute limit; Note that the existing system property |
|
285 |
* "elementAttributeLimit" with no prefix is still observed |
|
286 |
*/ |
|
287 |
public static final String SP_ELEMENT_ATTRIBUTE_LIMIT = "jdk.xml.elementAttributeLimit"; |
|
288 |
||
289 |
/** |
|
290 |
* JDK maxOccur limit; Note that the existing system property |
|
291 |
* "maxOccurLimit" with no prefix is still observed |
|
292 |
*/ |
|
293 |
public static final String SP_MAX_OCCUR_LIMIT = "jdk.xml.maxOccurLimit"; |
|
294 |
||
295 |
/** |
|
296 |
* JDK total entity size limit |
|
297 |
*/ |
|
298 |
public static final String SP_TOTAL_ENTITY_SIZE_LIMIT = "jdk.xml.totalEntitySizeLimit"; |
|
299 |
||
300 |
/** |
|
301 |
* JDK maximum general entity size limit |
|
302 |
*/ |
|
22418
1ee8fd0184d1
8028111: XML readers share the same entity expansion counter
joehw
parents:
22139
diff
changeset
|
303 |
public static final String SP_GENERAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit"; |
39799 | 304 |
|
305 |
/** |
|
306 |
* JDK node count limit in entities that limits the total number of nodes |
|
307 |
* in all of entity references. |
|
308 |
*/ |
|
309 |
public static final String SP_ENTITY_REPLACEMENT_LIMIT = "jdk.xml.entityReplacementLimit"; |
|
310 |
||
20968 | 311 |
/** |
312 |
* JDK maximum parameter entity size limit |
|
313 |
*/ |
|
314 |
public static final String SP_PARAMETER_ENTITY_SIZE_LIMIT = "jdk.xml.maxParameterEntitySizeLimit"; |
|
315 |
/** |
|
316 |
* JDK maximum XML name limit |
|
317 |
*/ |
|
318 |
public static final String SP_XML_NAME_LIMIT = "jdk.xml.maxXMLNameLimit"; |
|
319 |
||
25591 | 320 |
/** |
321 |
* JDK maxElementDepth limit |
|
322 |
*/ |
|
323 |
public static final String SP_MAX_ELEMENT_DEPTH = "jdk.xml.maxElementDepth"; |
|
324 |
||
20968 | 325 |
//legacy System Properties |
326 |
public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit"; |
|
327 |
public static final String ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ; |
|
328 |
public final static String MAX_OCCUR_LIMIT = "maxOccurLimit"; |
|
329 |
||
330 |
/** |
|
331 |
* A string "yes" that can be used for properties such as getEntityCountInfo |
|
332 |
*/ |
|
333 |
public static final String JDK_YES = "yes"; |
|
334 |
||
335 |
// |
|
12005 | 336 |
// DOM features |
337 |
// |
|
338 |
||
339 |
/** Comments feature ("include-comments"). */ |
|
340 |
public static final String INCLUDE_COMMENTS_FEATURE = "include-comments"; |
|
341 |
||
342 |
/** Create cdata nodes feature ("create-cdata-nodes"). */ |
|
343 |
public static final String CREATE_CDATA_NODES_FEATURE = "create-cdata-nodes"; |
|
344 |
||
345 |
/** Feature id: load as infoset. */ |
|
346 |
public static final String LOAD_AS_INFOSET = "load-as-infoset"; |
|
347 |
||
348 |
||
349 |
// |
|
350 |
// Constants: DOM Level 3 feature ids |
|
351 |
// |
|
352 |
||
353 |
public static final String DOM_CANONICAL_FORM = "canonical-form"; |
|
354 |
public static final String DOM_CDATA_SECTIONS ="cdata-sections"; |
|
355 |
||
356 |
public static final String DOM_COMMENTS = "comments"; |
|
357 |
||
358 |
// REVISIT: this feature seems to have no effect for Xerces |
|
359 |
||
360 |
public static final String DOM_CHARSET_OVERRIDES_XML_ENCODING = |
|
361 |
"charset-overrides-xml-encoding"; |
|
362 |
||
363 |
public static final String DOM_DATATYPE_NORMALIZATION = "datatype-normalization"; |
|
364 |
||
365 |
public static final String DOM_ENTITIES = "entities"; |
|
366 |
public static final String DOM_INFOSET = "infoset"; |
|
367 |
public static final String DOM_NAMESPACES = "namespaces"; |
|
368 |
public static final String DOM_NAMESPACE_DECLARATIONS = "namespace-declarations"; |
|
369 |
public static final String DOM_SUPPORTED_MEDIATYPES_ONLY = |
|
370 |
"supported-media-types-only"; |
|
371 |
||
372 |
public static final String DOM_VALIDATE_IF_SCHEMA = "validate-if-schema"; |
|
373 |
public static final String DOM_VALIDATE = "validate"; |
|
374 |
public static final String DOM_ELEMENT_CONTENT_WHITESPACE = |
|
375 |
"element-content-whitespace"; |
|
376 |
||
377 |
// DOM Level 3 features defined in Core: |
|
378 |
public static final String DOM_DISCARD_DEFAULT_CONTENT = "discard-default-content"; |
|
379 |
public static final String DOM_NORMALIZE_CHARACTERS = "normalize-characters"; |
|
380 |
public static final String DOM_CHECK_CHAR_NORMALIZATION = "check-character-normalization"; |
|
381 |
public static final String DOM_WELLFORMED = "well-formed"; |
|
382 |
public static final String DOM_SPLIT_CDATA = "split-cdata-sections"; |
|
383 |
||
384 |
// Load and Save |
|
385 |
public static final String DOM_FORMAT_PRETTY_PRINT = "format-pretty-print"; |
|
386 |
public static final String DOM_XMLDECL = "xml-declaration"; |
|
387 |
public static final String DOM_UNKNOWNCHARS = "unknown-characters"; |
|
388 |
public static final String DOM_CERTIFIED = "certified"; |
|
389 |
public static final String DOM_DISALLOW_DOCTYPE = "disallow-doctype"; |
|
390 |
public static final String DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS = "ignore-unknown-character-denormalizations"; |
|
391 |
||
392 |
// DOM Properties |
|
393 |
public static final String DOM_RESOURCE_RESOLVER = "resource-resolver"; |
|
394 |
public static final String DOM_ERROR_HANDLER = "error-handler"; |
|
395 |
public static final String DOM_SCHEMA_TYPE = "schema-type"; |
|
396 |
public static final String DOM_SCHEMA_LOCATION = "schema-location"; |
|
397 |
public static final String DOM_ANCESTOR_CHECCK = "ancestor-check"; |
|
398 |
// XSModel |
|
399 |
public static final String DOM_PSVI = "psvi"; |
|
400 |
||
401 |
||
402 |
// xerces features |
|
403 |
||
404 |
/** Xerces features prefix ("http://apache.org/xml/features/"). */ |
|
405 |
public static final String XERCES_FEATURE_PREFIX = "http://apache.org/xml/features/"; |
|
406 |
||
407 |
/** Schema validation feature ("validation/schema"). */ |
|
408 |
public static final String SCHEMA_VALIDATION_FEATURE = "validation/schema"; |
|
409 |
||
410 |
/** Expose schema normalized values */ |
|
411 |
public static final String SCHEMA_NORMALIZED_VALUE = "validation/schema/normalized-value"; |
|
412 |
||
413 |
/** Send schema default value via characters() */ |
|
414 |
public static final String SCHEMA_ELEMENT_DEFAULT = "validation/schema/element-default"; |
|
415 |
||
416 |
/** Schema full constraint checking ("validation/schema-full-checking"). */ |
|
417 |
public static final String SCHEMA_FULL_CHECKING = "validation/schema-full-checking"; |
|
418 |
||
419 |
/** Augment Post-Schema-Validation-Infoset */ |
|
420 |
public static final String SCHEMA_AUGMENT_PSVI = "validation/schema/augment-psvi"; |
|
421 |
||
422 |
/** Dynamic validation feature ("validation/dynamic"). */ |
|
423 |
public static final String DYNAMIC_VALIDATION_FEATURE = "validation/dynamic"; |
|
424 |
||
425 |
/** Warn on duplicate attribute declaration feature ("validation/warn-on-duplicate-attdef"). */ |
|
426 |
public static final String WARN_ON_DUPLICATE_ATTDEF_FEATURE = "validation/warn-on-duplicate-attdef"; |
|
427 |
||
428 |
/** Warn on undeclared element feature ("validation/warn-on-undeclared-elemdef"). */ |
|
429 |
public static final String WARN_ON_UNDECLARED_ELEMDEF_FEATURE = "validation/warn-on-undeclared-elemdef"; |
|
430 |
||
431 |
/** Warn on duplicate entity declaration feature ("warn-on-duplicate-entitydef"). */ |
|
432 |
public static final String WARN_ON_DUPLICATE_ENTITYDEF_FEATURE = "warn-on-duplicate-entitydef"; |
|
433 |
||
434 |
/** Allow Java encoding names feature ("allow-java-encodings"). */ |
|
435 |
public static final String ALLOW_JAVA_ENCODINGS_FEATURE = "allow-java-encodings"; |
|
436 |
||
437 |
/** Disallow DOCTYPE declaration feature ("disallow-doctype-decl"). */ |
|
438 |
public static final String DISALLOW_DOCTYPE_DECL_FEATURE = "disallow-doctype-decl"; |
|
439 |
||
440 |
/** Continue after fatal error feature ("continue-after-fatal-error"). */ |
|
441 |
public static final String CONTINUE_AFTER_FATAL_ERROR_FEATURE = "continue-after-fatal-error"; |
|
442 |
||
443 |
/** Load dtd grammar when nonvalidating feature ("nonvalidating/load-dtd-grammar"). */ |
|
444 |
public static final String LOAD_DTD_GRAMMAR_FEATURE = "nonvalidating/load-dtd-grammar"; |
|
445 |
||
446 |
/** Load external dtd when nonvalidating feature ("nonvalidating/load-external-dtd"). */ |
|
447 |
public static final String LOAD_EXTERNAL_DTD_FEATURE = "nonvalidating/load-external-dtd"; |
|
448 |
||
449 |
/** Defer node expansion feature ("dom/defer-node-expansion"). */ |
|
450 |
public static final String DEFER_NODE_EXPANSION_FEATURE = "dom/defer-node-expansion"; |
|
451 |
||
452 |
/** Create entity reference nodes feature ("dom/create-entity-ref-nodes"). */ |
|
453 |
public static final String CREATE_ENTITY_REF_NODES_FEATURE = "dom/create-entity-ref-nodes"; |
|
454 |
||
455 |
/** Include ignorable whitespace feature ("dom/include-ignorable-whitespace"). */ |
|
456 |
public static final String INCLUDE_IGNORABLE_WHITESPACE = "dom/include-ignorable-whitespace"; |
|
457 |
||
458 |
/** Default attribute values feature ("validation/default-attribute-values"). */ |
|
459 |
public static final String DEFAULT_ATTRIBUTE_VALUES_FEATURE = "validation/default-attribute-values"; |
|
460 |
||
461 |
/** Validate content models feature ("validation/validate-content-models"). */ |
|
462 |
public static final String VALIDATE_CONTENT_MODELS_FEATURE = "validation/validate-content-models"; |
|
463 |
||
464 |
/** Validate datatypes feature ("validation/validate-datatypes"). */ |
|
465 |
public static final String VALIDATE_DATATYPES_FEATURE = "validation/validate-datatypes"; |
|
466 |
||
467 |
/** Balance syntax trees feature ("validation/balance-syntax-trees"). */ |
|
468 |
public static final String BALANCE_SYNTAX_TREES = "validation/balance-syntax-trees"; |
|
469 |
||
470 |
/** Notify character references feature (scanner/notify-char-refs"). */ |
|
471 |
public static final String NOTIFY_CHAR_REFS_FEATURE = "scanner/notify-char-refs"; |
|
472 |
||
473 |
/** Notify built-in (&amp;, etc.) references feature (scanner/notify-builtin-refs"). */ |
|
474 |
public static final String NOTIFY_BUILTIN_REFS_FEATURE = "scanner/notify-builtin-refs"; |
|
475 |
||
476 |
/** Standard URI conformant feature ("standard-uri-conformant"). */ |
|
477 |
public static final String STANDARD_URI_CONFORMANT_FEATURE = "standard-uri-conformant"; |
|
478 |
||
479 |
/** Generate synthetic annotations feature ("generate-synthetic-annotations"). */ |
|
480 |
public static final String GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE = "generate-synthetic-annotations"; |
|
481 |
||
482 |
/** Validate annotations feature ("validate-annotations"). */ |
|
483 |
public static final String VALIDATE_ANNOTATIONS_FEATURE = "validate-annotations"; |
|
484 |
||
485 |
||
486 |
/** Honour all schemaLocations feature ("honour-all-schemaLocations"). */ |
|
487 |
public static final String HONOUR_ALL_SCHEMALOCATIONS_FEATURE = "honour-all-schemaLocations"; |
|
488 |
||
489 |
/** Namespace growth feature ("namespace-growth"). */ |
|
490 |
public static final String NAMESPACE_GROWTH_FEATURE = "namespace-growth"; |
|
491 |
||
492 |
/** Tolerate duplicates feature ("internal/tolerate-duplicates"). */ |
|
493 |
public static final String TOLERATE_DUPLICATES_FEATURE = "internal/tolerate-duplicates"; |
|
494 |
||
495 |
/** XInclude processing feature ("xinclude"). */ |
|
496 |
public static final String XINCLUDE_FEATURE = "xinclude"; |
|
497 |
||
498 |
/** XInclude fixup base URIs feature ("xinclude/fixup-base-uris"). */ |
|
499 |
public static final String XINCLUDE_FIXUP_BASE_URIS_FEATURE = "xinclude/fixup-base-uris"; |
|
500 |
||
501 |
/** XInclude fixup language feature ("xinclude/fixup-language"). */ |
|
502 |
public static final String XINCLUDE_FIXUP_LANGUAGE_FEATURE = "xinclude/fixup-language"; |
|
503 |
||
26257
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
504 |
/** |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
505 |
* Feature to ignore xsi:type attributes on elements during validation, |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
506 |
* until a global element declaration is found. ("validation/schema/ignore-xsi-type-until-elemdecl") |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
507 |
* If this feature is on when validating a document, then beginning at the validation root |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
508 |
* element, xsi:type attributes are ignored until a global element declaration is |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
509 |
* found for an element. Once a global element declaration has been found, xsi:type |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
510 |
* attributes will start being processed for the sub-tree beginning at the element for |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
511 |
* which the declaration was found. |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
512 |
* |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
513 |
* Suppose an element A has two element children, B and C. |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
514 |
* |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
515 |
* If a global element declaration is found for A, xsi:type attributes on A, B and C, |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
516 |
* and all of B and C's descendents, will be processed. |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
517 |
* |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
518 |
* If no global element declaration is found for A or B, but one is found for C, |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
519 |
* then xsi:type attributes will be ignored on A and B (and any descendents of B, |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
520 |
* until a global element declaration is found), but xsi:type attributes will be |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
521 |
* processed for C and all of C's descendents. |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
522 |
* |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
523 |
* Once xsi:type attributes stop being ignored for a subtree, they do not start |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
524 |
* being ignored again, even if more elements are encountered for which no global |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
525 |
* element declaration can be found. |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
526 |
*/ |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
527 |
public static final String IGNORE_XSI_TYPE_FEATURE = "validation/schema/ignore-xsi-type-until-elemdecl"; |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
528 |
|
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
529 |
/** Perform checking of ID/IDREFs ("validation/id-idref-checking") */ |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
530 |
public static final String ID_IDREF_CHECKING_FEATURE = "validation/id-idref-checking"; |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
531 |
|
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
532 |
/** Feature to ignore errors caused by identity constraints ("validation/identity-constraint-checking") */ |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
533 |
public static final String IDC_CHECKING_FEATURE = "validation/identity-constraint-checking"; |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
534 |
|
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
535 |
/** Feature to ignore errors caused by unparsed entities ("validation/unparsed-entity-checking") */ |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
536 |
public static final String UNPARSED_ENTITY_CHECKING_FEATURE = "validation/unparsed-entity-checking"; |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
537 |
|
12005 | 538 |
/** |
539 |
* Internal feature. When set to true the schema validator will only use |
|
540 |
* schema components from the grammar pool provided. |
|
541 |
*/ |
|
542 |
public static final String USE_GRAMMAR_POOL_ONLY_FEATURE = "internal/validation/schema/use-grammar-pool-only"; |
|
543 |
||
544 |
/** Internal performance related feature: |
|
545 |
* false - the parser settings (features/properties) have not changed between 2 parses |
|
546 |
* true - the parser settings have changed between 2 parses |
|
547 |
* NOTE: this feature should only be set by the parser configuration. |
|
548 |
*/ |
|
549 |
public static final String PARSER_SETTINGS = "internal/parser-settings"; |
|
550 |
||
551 |
||
552 |
/** Feature to make XML Processor XInclude Aware */ |
|
553 |
public static final String XINCLUDE_AWARE = "xinclude-aware"; |
|
554 |
||
555 |
/** Ignore xsi:schemaLocation and xsi:noNamespaceSchemaLocation. */ |
|
556 |
public static final String IGNORE_SCHEMA_LOCATION_HINTS = "validation/schema/ignore-schema-location-hints"; |
|
557 |
||
558 |
/** |
|
559 |
* When true, the schema processor will change characters events |
|
560 |
* to ignorableWhitespaces events, when characters are expected to |
|
561 |
* only contain ignorable whitespaces. |
|
562 |
*/ |
|
563 |
public static final String CHANGE_IGNORABLE_CHARACTERS_INTO_IGNORABLE_WHITESPACES = |
|
564 |
"validation/change-ignorable-characters-into-ignorable-whitespaces"; |
|
565 |
||
566 |
// xerces properties |
|
567 |
||
568 |
/** Xerces properties prefix ("http://apache.org/xml/properties/"). */ |
|
569 |
public static final String XERCES_PROPERTY_PREFIX = "http://apache.org/xml/properties/"; |
|
570 |
||
571 |
/** Current element node property ("dom/current-element-node"). */ |
|
572 |
public static final String CURRENT_ELEMENT_NODE_PROPERTY = "dom/current-element-node"; |
|
573 |
||
574 |
/** Document class name property ("dom/document-class-name"). */ |
|
575 |
public static final String DOCUMENT_CLASS_NAME_PROPERTY = "dom/document-class-name"; |
|
576 |
||
577 |
/** Symbol table property ("internal/symbol-table"). */ |
|
578 |
public static final String SYMBOL_TABLE_PROPERTY = "internal/symbol-table"; |
|
579 |
||
580 |
/** Error reporter property ("internal/error-reporter"). */ |
|
581 |
public static final String ERROR_REPORTER_PROPERTY = "internal/error-reporter"; |
|
582 |
||
583 |
/** Error handler property ("internal/error-handler"). */ |
|
584 |
public static final String ERROR_HANDLER_PROPERTY = "internal/error-handler"; |
|
585 |
||
586 |
/** XInclude handler property ("internal/xinclude-handler"). */ |
|
587 |
public static final String XINCLUDE_HANDLER_PROPERTY = "internal/xinclude-handler"; |
|
588 |
||
589 |
/** XPointer handler property ("internal/xpointer-handler"). */ |
|
590 |
public static final String XPOINTER_HANDLER_PROPERTY = "internal/xpointer-handler"; |
|
591 |
||
592 |
/** Entity manager property ("internal/entity-manager"). */ |
|
593 |
public static final String ENTITY_MANAGER_PROPERTY = "internal/entity-manager"; |
|
594 |
/** Input buffer size property ("input-buffer-size"). */ |
|
595 |
public static final String BUFFER_SIZE_PROPERTY = "input-buffer-size"; |
|
596 |
||
597 |
/** Security manager property ("security-manager"). */ |
|
598 |
public static final String SECURITY_MANAGER_PROPERTY = "security-manager"; |
|
599 |
||
600 |
/** Locale property ("locale"). */ |
|
601 |
public static final String LOCALE_PROPERTY = "locale"; |
|
602 |
||
603 |
/** property identifier: security manager. */ |
|
20968 | 604 |
public static final String SECURITY_MANAGER = |
12005 | 605 |
Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; |
606 |
||
607 |
||
608 |
public static final String ENTITY_RESOLVER_PROPERTY = "internal/entity-resolver"; |
|
609 |
||
610 |
/** Grammar pool property ("internal/grammar-pool"). */ |
|
611 |
public static final String XMLGRAMMAR_POOL_PROPERTY = "internal/grammar-pool"; |
|
612 |
||
613 |
/** Datatype validator factory ("internal/datatype-validator-factory"). */ |
|
614 |
public static final String DATATYPE_VALIDATOR_FACTORY_PROPERTY = "internal/datatype-validator-factory"; |
|
615 |
||
616 |
/** Document scanner property ("internal/document-scanner"). */ |
|
617 |
public static final String DOCUMENT_SCANNER_PROPERTY = "internal/document-scanner"; |
|
618 |
||
619 |
/** DTD scanner property ("internal/dtd-scanner"). */ |
|
620 |
public static final String DTD_SCANNER_PROPERTY = "internal/dtd-scanner"; |
|
621 |
||
622 |
/** DTD processor property ("internal/dtd-processor"). */ |
|
623 |
public static final String DTD_PROCESSOR_PROPERTY = "internal/dtd-processor"; |
|
624 |
||
625 |
/** Validator property ("internal/validator"). */ |
|
626 |
public static final String VALIDATOR_PROPERTY = "internal/validator"; |
|
627 |
||
628 |
/** Validator property ("internal/validator/dtd"). */ |
|
629 |
public static final String DTD_VALIDATOR_PROPERTY = "internal/validator/dtd"; |
|
630 |
||
631 |
/** Validator property ("internal/validator/schema"). */ |
|
632 |
public static final String SCHEMA_VALIDATOR_PROPERTY = "internal/validator/schema"; |
|
633 |
||
634 |
/** No namespace schema location property ("schema/external-schemaLocation"). */ |
|
635 |
public static final String SCHEMA_LOCATION = "schema/external-schemaLocation"; |
|
636 |
||
637 |
/** Schema location property ("schema/external-noNamespaceSchemaLocation"). */ |
|
638 |
public static final String SCHEMA_NONS_LOCATION = "schema/external-noNamespaceSchemaLocation"; |
|
639 |
||
640 |
/** Namespace binder property ("internal/namespace-binder"). */ |
|
641 |
public static final String NAMESPACE_BINDER_PROPERTY = "internal/namespace-binder"; |
|
642 |
||
643 |
/** Namespace context property ("internal/namespace-context"). */ |
|
644 |
public static final String NAMESPACE_CONTEXT_PROPERTY = "internal/namespace-context"; |
|
645 |
||
646 |
/** Validation manager property ("internal/validation-manager"). */ |
|
647 |
public static final String VALIDATION_MANAGER_PROPERTY = "internal/validation-manager"; |
|
648 |
||
27111
7a491d709b83
8036951: Xerces Update: XMLSchemaValidator.java and XMLSchemaLoader.java
joehw
parents:
26257
diff
changeset
|
649 |
/** Schema type for the root element in a document ("validation/schema/root-type-definition"). */ |
26257
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
650 |
public static final String ROOT_TYPE_DEFINITION_PROPERTY = "validation/schema/root-type-definition"; |
12005 | 651 |
|
27111
7a491d709b83
8036951: Xerces Update: XMLSchemaValidator.java and XMLSchemaLoader.java
joehw
parents:
26257
diff
changeset
|
652 |
/** Schema element declaration for the root element in a document ("validation/schema/root-element-declaration"). */ |
7a491d709b83
8036951: Xerces Update: XMLSchemaValidator.java and XMLSchemaLoader.java
joehw
parents:
26257
diff
changeset
|
653 |
public static final String ROOT_ELEMENT_DECLARATION_PROPERTY = "validation/schema/root-element-declaration"; |
7a491d709b83
8036951: Xerces Update: XMLSchemaValidator.java and XMLSchemaLoader.java
joehw
parents:
26257
diff
changeset
|
654 |
|
12005 | 655 |
/** XPointer Schema property ("xpointer-schema"). */ |
656 |
public static final String XPOINTER_SCHEMA_PROPERTY = "xpointer-schema"; |
|
657 |
||
658 |
/** Schema element declaration for the root element in a document ("internal/validation/schema/dv-factory"). */ |
|
659 |
public static final String SCHEMA_DV_FACTORY_PROPERTY = "internal/validation/schema/dv-factory"; |
|
660 |
||
661 |
||
662 |
// general constants |
|
663 |
||
664 |
/** Element PSVI is stored in augmentations using string "ELEMENT_PSVI" */ |
|
665 |
public final static String ELEMENT_PSVI = "ELEMENT_PSVI"; |
|
666 |
||
667 |
/** Attribute PSVI is stored in augmentations using string "ATTRIBUTE_PSVI" */ |
|
668 |
public final static String ATTRIBUTE_PSVI = "ATTRIBUTE_PSVI"; |
|
669 |
||
670 |
/** |
|
671 |
* Boolean indicating whether an attribute is declared in the DTD is stored |
|
672 |
* in augmentations using the string "ATTRIBUTE_DECLARED". The absence of this |
|
673 |
* augmentation indicates that the attribute was not declared in the DTD. |
|
674 |
*/ |
|
675 |
public final static String ATTRIBUTE_DECLARED = "ATTRIBUTE_DECLARED"; |
|
676 |
||
677 |
||
678 |
/** |
|
679 |
* {@link org.w3c.dom.TypeInfo} associated with current element/attribute |
|
680 |
* is stored in augmentations using this string as the key. |
|
681 |
* |
|
682 |
* This will ultimately controls {@link com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser} |
|
683 |
* regarding what object the DOM will return from |
|
684 |
* {@link org.w3c.dom.Attr#getSchemaTypeInfo()} and |
|
685 |
* {@link org.w3c.dom.Element#getSchemaTypeInfo()} and |
|
686 |
*/ |
|
687 |
public final static String TYPEINFO = "org.w3c.dom.TypeInfo"; |
|
688 |
||
689 |
/** |
|
690 |
* Whether an attribute is an id or not is stored in augmentations |
|
691 |
* using this string as the key. The value is {@link Boolean#TRUE} |
|
692 |
* or {@link Boolean#FALSE}. |
|
693 |
* |
|
694 |
* This will ultimately controls {@link com.sun.org.apache.xerces.internal.parsers.AbstractDOMParser} |
|
695 |
* about whether it will mark an attribute as ID or not. |
|
696 |
*/ |
|
697 |
public final static String ID_ATTRIBUTE = "ID_ATTRIBUTE"; |
|
698 |
||
699 |
// XML version constants |
|
700 |
||
701 |
/** |
|
702 |
* Boolean indicating whether an entity referenced in the document has |
|
703 |
* not been read is stored in augmentations using the string "ENTITY_SKIPPED". |
|
704 |
* The absence of this augmentation indicates that the entity had a |
|
705 |
* declaration and was expanded. |
|
706 |
*/ |
|
707 |
public final static String ENTITY_SKIPPED = "ENTITY_SKIPPED"; |
|
708 |
||
709 |
/** |
|
710 |
* Boolean indicating whether a character is a probable white space |
|
711 |
* character (ch <= 0x20) that was the replacement text of a character |
|
712 |
* reference is stored in augmentations using the string "CHAR_REF_PROBABLE_WS". |
|
713 |
* The absence of this augmentation indicates that the character is not |
|
714 |
* probable white space and/or was not included from a character reference. |
|
715 |
*/ |
|
716 |
public final static String CHAR_REF_PROBABLE_WS = "CHAR_REF_PROBABLE_WS"; |
|
717 |
||
718 |
/** Boolean indicating if this entity is the last opened entity. |
|
719 |
* |
|
720 |
*@see com.sun.org.apache.xerces.internal.impl.XMLEntityManager#endEntity() |
|
721 |
*@see com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl#endEntity() |
|
722 |
*@see com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl#endEntity() |
|
723 |
*/ |
|
724 |
public final static String LAST_ENTITY = "LAST_ENTITY"; |
|
725 |
||
726 |
// XML version constants |
|
727 |
public final static short XML_VERSION_ERROR = -1; |
|
728 |
public final static short XML_VERSION_1_0 = 1; |
|
729 |
public final static short XML_VERSION_1_1 = 2; |
|
730 |
||
731 |
||
732 |
||
733 |
// DOM related constants |
|
734 |
public final static String ANONYMOUS_TYPE_NAMESPACE = |
|
735 |
"http://apache.org/xml/xmlschema/1.0/anonymousTypes"; |
|
736 |
||
737 |
||
738 |
||
739 |
// Constant to enable Schema 1.1 support |
|
740 |
public final static boolean SCHEMA_1_1_SUPPORT = false; |
|
741 |
public final static short SCHEMA_VERSION_1_0 = 1; |
|
742 |
public final static short SCHEMA_VERSION_1_0_EXTENDED = 2; |
|
743 |
||
744 |
// private |
|
745 |
||
746 |
/** SAX features. */ |
|
747 |
private static final String[] fgSAXFeatures = { |
|
748 |
NAMESPACES_FEATURE, |
|
749 |
NAMESPACE_PREFIXES_FEATURE, |
|
750 |
STRING_INTERNING_FEATURE, |
|
751 |
VALIDATION_FEATURE, |
|
752 |
EXTERNAL_GENERAL_ENTITIES_FEATURE, |
|
753 |
EXTERNAL_PARAMETER_ENTITIES_FEATURE, |
|
754 |
}; |
|
755 |
||
756 |
/** SAX properties. */ |
|
757 |
private static final String[] fgSAXProperties = { |
|
758 |
DECLARATION_HANDLER_PROPERTY, |
|
759 |
LEXICAL_HANDLER_PROPERTY, |
|
760 |
DOM_NODE_PROPERTY, |
|
761 |
XML_STRING_PROPERTY, |
|
762 |
}; |
|
763 |
||
764 |
/** Xerces features. */ |
|
765 |
private static final String[] fgXercesFeatures = { |
|
766 |
||
767 |
SCHEMA_VALIDATION_FEATURE, |
|
768 |
SCHEMA_FULL_CHECKING, |
|
769 |
DYNAMIC_VALIDATION_FEATURE, |
|
770 |
WARN_ON_DUPLICATE_ATTDEF_FEATURE, |
|
771 |
WARN_ON_UNDECLARED_ELEMDEF_FEATURE, |
|
772 |
ALLOW_JAVA_ENCODINGS_FEATURE, |
|
773 |
CONTINUE_AFTER_FATAL_ERROR_FEATURE, |
|
774 |
LOAD_DTD_GRAMMAR_FEATURE, |
|
775 |
LOAD_EXTERNAL_DTD_FEATURE, |
|
776 |
//DEFER_NODE_EXPANSION_FEATURE, |
|
777 |
CREATE_ENTITY_REF_NODES_FEATURE, |
|
778 |
XINCLUDE_AWARE, |
|
779 |
INCLUDE_IGNORABLE_WHITESPACE, |
|
780 |
//GRAMMAR_ACCESS_FEATURE, |
|
781 |
DEFAULT_ATTRIBUTE_VALUES_FEATURE, |
|
782 |
VALIDATE_CONTENT_MODELS_FEATURE, |
|
783 |
VALIDATE_DATATYPES_FEATURE, |
|
784 |
BALANCE_SYNTAX_TREES, |
|
785 |
NOTIFY_CHAR_REFS_FEATURE, |
|
786 |
NOTIFY_BUILTIN_REFS_FEATURE, |
|
787 |
DISALLOW_DOCTYPE_DECL_FEATURE, |
|
788 |
STANDARD_URI_CONFORMANT_FEATURE, |
|
789 |
GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE, |
|
790 |
VALIDATE_ANNOTATIONS_FEATURE, |
|
791 |
HONOUR_ALL_SCHEMALOCATIONS_FEATURE, |
|
792 |
XINCLUDE_FEATURE, |
|
793 |
XINCLUDE_FIXUP_BASE_URIS_FEATURE, |
|
794 |
XINCLUDE_FIXUP_LANGUAGE_FEATURE, |
|
26257
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
795 |
IGNORE_XSI_TYPE_FEATURE, |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
796 |
ID_IDREF_CHECKING_FEATURE, |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
797 |
IDC_CHECKING_FEATURE, |
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
798 |
UNPARSED_ENTITY_CHECKING_FEATURE, |
12005 | 799 |
NAMESPACE_GROWTH_FEATURE, |
800 |
TOLERATE_DUPLICATES_FEATURE, |
|
801 |
}; |
|
802 |
||
803 |
/** Xerces properties. */ |
|
804 |
private static final String[] fgXercesProperties = { |
|
805 |
CURRENT_ELEMENT_NODE_PROPERTY, |
|
806 |
DOCUMENT_CLASS_NAME_PROPERTY, |
|
807 |
SYMBOL_TABLE_PROPERTY, |
|
808 |
ERROR_HANDLER_PROPERTY, |
|
809 |
ERROR_REPORTER_PROPERTY, |
|
810 |
ENTITY_MANAGER_PROPERTY, |
|
811 |
ENTITY_RESOLVER_PROPERTY, |
|
812 |
XMLGRAMMAR_POOL_PROPERTY, |
|
813 |
DATATYPE_VALIDATOR_FACTORY_PROPERTY, |
|
814 |
DOCUMENT_SCANNER_PROPERTY, |
|
815 |
DTD_SCANNER_PROPERTY, |
|
816 |
VALIDATOR_PROPERTY, |
|
817 |
SCHEMA_LOCATION, |
|
818 |
SCHEMA_NONS_LOCATION, |
|
819 |
VALIDATION_MANAGER_PROPERTY, |
|
820 |
BUFFER_SIZE_PROPERTY, |
|
821 |
SECURITY_MANAGER_PROPERTY, |
|
26257
4ec17c54acb3
8037819: Xerces Update: jaxp/validation/XMLSchemaFactory
joehw
parents:
25868
diff
changeset
|
822 |
ROOT_TYPE_DEFINITION_PROPERTY, |
27111
7a491d709b83
8036951: Xerces Update: XMLSchemaValidator.java and XMLSchemaLoader.java
joehw
parents:
26257
diff
changeset
|
823 |
ROOT_ELEMENT_DECLARATION_PROPERTY, |
12005 | 824 |
LOCALE_PROPERTY, |
825 |
SCHEMA_DV_FACTORY_PROPERTY, |
|
826 |
}; |
|
827 |
||
828 |
/** Empty enumeration. */ |
|
829 |
private static final Enumeration fgEmptyEnumeration = new ArrayEnumeration(new Object[] {}); |
|
830 |
||
831 |
// |
|
832 |
// Constructors |
|
833 |
// |
|
834 |
||
835 |
/** This class cannot be instantiated. */ |
|
836 |
private Constants() {} |
|
837 |
||
838 |
// |
|
839 |
// Public methods |
|
840 |
// |
|
841 |
||
842 |
// sax |
|
843 |
||
844 |
/** Returns an enumeration of the SAX features. */ |
|
845 |
public static Enumeration getSAXFeatures() { |
|
846 |
return fgSAXFeatures.length > 0 |
|
847 |
? new ArrayEnumeration(fgSAXFeatures) : fgEmptyEnumeration; |
|
848 |
} // getSAXFeatures():Enumeration |
|
849 |
||
850 |
/** Returns an enumeration of the SAX properties. */ |
|
851 |
public static Enumeration getSAXProperties() { |
|
852 |
return fgSAXProperties.length > 0 |
|
853 |
? new ArrayEnumeration(fgSAXProperties) : fgEmptyEnumeration; |
|
854 |
} // getSAXProperties():Enumeration |
|
855 |
||
856 |
// xerces |
|
857 |
||
858 |
/** Returns an enumeration of the Xerces features. */ |
|
859 |
public static Enumeration getXercesFeatures() { |
|
860 |
return fgXercesFeatures.length > 0 |
|
861 |
? new ArrayEnumeration(fgXercesFeatures) : fgEmptyEnumeration; |
|
862 |
} // getXercesFeatures():Enumeration |
|
863 |
||
864 |
/** Returns an enumeration of the Xerces properties. */ |
|
865 |
public static Enumeration getXercesProperties() { |
|
866 |
return fgXercesProperties.length > 0 |
|
867 |
? new ArrayEnumeration(fgXercesProperties) : fgEmptyEnumeration; |
|
868 |
} // getXercesProperties():Enumeration |
|
869 |
||
870 |
// |
|
871 |
// Classes |
|
872 |
// |
|
873 |
||
874 |
/** |
|
875 |
* An array enumeration. |
|
876 |
* |
|
877 |
* @author Andy Clark, IBM |
|
878 |
*/ |
|
879 |
static class ArrayEnumeration |
|
880 |
implements Enumeration { |
|
881 |
||
882 |
// |
|
883 |
// Data |
|
884 |
// |
|
885 |
||
886 |
/** Array. */ |
|
887 |
private Object[] array; |
|
888 |
||
889 |
/** Index. */ |
|
890 |
private int index; |
|
891 |
||
892 |
// |
|
893 |
// Constructors |
|
894 |
// |
|
895 |
||
896 |
/** Constructs an array enumeration. */ |
|
897 |
public ArrayEnumeration(Object[] array) { |
|
898 |
this.array = array; |
|
899 |
} // <init>(Object[]) |
|
900 |
||
901 |
// |
|
902 |
// Enumeration methods |
|
903 |
// |
|
904 |
||
905 |
/** |
|
906 |
* Tests if this enumeration contains more elements. |
|
907 |
* |
|
908 |
* @return <code>true</code> if this enumeration contains more elements; |
|
909 |
* <code>false</code> otherwise. |
|
910 |
* @since JDK1.0 |
|
911 |
*/ |
|
912 |
public boolean hasMoreElements() { |
|
913 |
return index < array.length; |
|
914 |
} // hasMoreElement():boolean |
|
915 |
||
916 |
/** |
|
917 |
* Returns the next element of this enumeration. |
|
918 |
* |
|
919 |
* @return the next element of this enumeration. |
|
920 |
* @exception NoSuchElementException if no more elements exist. |
|
921 |
* @since JDK1.0 |
|
922 |
*/ |
|
923 |
public Object nextElement() { |
|
924 |
if (index < array.length) { |
|
925 |
return array[index++]; |
|
926 |
} |
|
927 |
throw new NoSuchElementException(); |
|
928 |
} // nextElement():Object |
|
929 |
||
930 |
} // class ArrayEnumeration |
|
931 |
||
932 |
// |
|
933 |
// MAIN |
|
934 |
// |
|
935 |
||
936 |
/** Prints all of the constants to standard output. */ |
|
937 |
public static void main(String[] argv) { |
|
938 |
||
939 |
print("SAX features:", SAX_FEATURE_PREFIX, fgSAXFeatures); |
|
940 |
print("SAX properties:", SAX_PROPERTY_PREFIX, fgSAXProperties); |
|
941 |
print("Xerces features:", XERCES_FEATURE_PREFIX, fgXercesFeatures); |
|
942 |
print("Xerces properties:", XERCES_PROPERTY_PREFIX, fgXercesProperties); |
|
943 |
||
944 |
} // main(String[]) |
|
945 |
||
946 |
/** Prints a list of features/properties. */ |
|
947 |
private static void print(String header, String prefix, Object[] array) { |
|
948 |
System.out.print(header); |
|
949 |
if (array.length > 0) { |
|
950 |
System.out.println(); |
|
951 |
for (int i = 0; i < array.length; i++) { |
|
952 |
System.out.print(" "); |
|
953 |
System.out.print(prefix); |
|
954 |
System.out.println(array[i]); |
|
955 |
} |
|
956 |
} |
|
957 |
else { |
|
958 |
System.out.println(" none."); |
|
959 |
} |
|
960 |
} // print(String,String,Object[]) |
|
961 |
||
962 |
} // class Constants |