~ubuntu-branches/ubuntu/karmic/libxerces2-java/karmic

« back to all changes in this revision

Viewing changes to src/org/apache/xerces/impl/Constants.java

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-12-04 17:37:55 UTC
  • mfrom: (2.1.2 etch)
  • Revision ID: james.westby@ubuntu.com-20061204173755-hb6ybrrrk097zhx7
Tags: 2.8.1-1ubuntu1
* Merge with Debian unstable; remaining changes:
  - Build -gcj package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * The Apache Software License, Version 1.1
3
 
 *
4
 
 *
5
 
 * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
6
 
 * reserved.
7
 
 *
8
 
 * Redistribution and use in source and binary forms, with or without
9
 
 * modification, are permitted provided that the following conditions
10
 
 * are met:
11
 
 *
12
 
 * 1. Redistributions of source code must retain the above copyright
13
 
 *    notice, this list of conditions and the following disclaimer.
14
 
 *
15
 
 * 2. Redistributions in binary form must reproduce the above copyright
16
 
 *    notice, this list of conditions and the following disclaimer in
17
 
 *    the documentation and/or other materials provided with the
18
 
 *    distribution.
19
 
 *
20
 
 * 3. The end-user documentation included with the redistribution,
21
 
 *    if any, must include the following acknowledgment:
22
 
 *       "This product includes software developed by the
23
 
 *        Apache Software Foundation (http://www.apache.org/)."
24
 
 *    Alternately, this acknowledgment may appear in the software itself,
25
 
 *    if and wherever such third-party acknowledgments normally appear.
26
 
 *
27
 
 * 4. The names "Xerces" and "Apache Software Foundation" must
28
 
 *    not be used to endorse or promote products derived from this
29
 
 *    software without prior written permission. For written
30
 
 *    permission, please contact apache@apache.org.
31
 
 *
32
 
 * 5. Products derived from this software may not be called "Apache",
33
 
 *    nor may "Apache" appear in their name, without prior written
34
 
 *    permission of the Apache Software Foundation.
35
 
 *
36
 
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37
 
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38
 
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39
 
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
40
 
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41
 
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42
 
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43
 
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44
 
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45
 
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46
 
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47
 
 * SUCH DAMAGE.
48
 
 * ====================================================================
49
 
 *
50
 
 * This software consists of voluntary contributions made by many
51
 
 * individuals on behalf of the Apache Software Foundation and was
52
 
 * originally based on software copyright (c) 1999, International
53
 
 * Business Machines, Inc., http://www.apache.org.  For more
54
 
 * information on the Apache Software Foundation, please see
55
 
 * <http://www.apache.org/>.
 
2
 * Copyright 2000-2006 The Apache Software Foundation.
 
3
 * 
 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
 
5
 * you may not use this file except in compliance with the License.
 
6
 * You may obtain a copy of the License at
 
7
 * 
 
8
 *      http://www.apache.org/licenses/LICENSE-2.0
 
9
 * 
 
10
 * Unless required by applicable law or agreed to in writing, software
 
11
 * distributed under the License is distributed on an "AS IS" BASIS,
 
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
 * See the License for the specific language governing permissions and
 
14
 * limitations under the License.
56
15
 */
57
16
 
58
17
package org.apache.xerces.impl;
62
21
 
63
22
/**
64
23
 * Commonly used constants.
 
24
 * 
 
25
 * @xerces.internal
65
26
 *
66
27
 * @author Andy Clark, IBM
67
28
 *
68
 
 * @version $Id: Constants.java,v 1.37 2004/01/21 21:23:28 mrglavas Exp $
 
29
 * @version $Id: Constants.java 371617 2006-01-23 18:41:49Z mrglavas $
69
30
 */
70
31
public final class Constants {
71
 
 
 
32
    
72
33
    //
73
34
    // Constants
74
35
    //
75
36
    // Schema Types:
76
37
    public static final String NS_XMLSCHEMA = "http://www.w3.org/2001/XMLSchema".intern();
77
38
    public static final String NS_DTD = "http://www.w3.org/TR/REC-xml".intern();
78
 
 
 
39
    
79
40
    // sax features
80
 
 
 
41
    
81
42
    /** SAX feature prefix ("http://xml.org/sax/features/"). */
82
43
    public static final String SAX_FEATURE_PREFIX = "http://xml.org/sax/features/";
83
 
 
 
44
    
84
45
    /** Namespaces feature ("namespaces"). */
85
46
    public static final String NAMESPACES_FEATURE = "namespaces";
86
 
 
 
47
    
87
48
    /** Namespace prefixes feature ("namespace-prefixes"). */
88
49
    public static final String NAMESPACE_PREFIXES_FEATURE = "namespace-prefixes";
89
 
 
 
50
    
90
51
    /** String interning feature ("string-interning"). */
91
52
    public static final String STRING_INTERNING_FEATURE = "string-interning";
92
 
 
 
53
    
93
54
    /** Validation feature ("validation"). */
94
55
    public static final String VALIDATION_FEATURE = "validation";
95
 
 
 
56
    
96
57
    /** External general entities feature ("external-general-entities "). */
97
58
    public static final String EXTERNAL_GENERAL_ENTITIES_FEATURE = "external-general-entities";
98
 
 
 
59
    
99
60
    /** External parameter entities feature ("external-parameter-entities "). */
100
61
    public static final String EXTERNAL_PARAMETER_ENTITIES_FEATURE = "external-parameter-entities";
101
 
 
 
62
    
 
63
    /** Lexical handler parameter entities feature ("lexical-handler/parameter-entities"). */
 
64
    public static final String LEXICAL_HANDLER_PARAMETER_ENTITIES_FEATURE = "lexical-handler/parameter-entities";
 
65
    
 
66
    /** Is standalone feature ("is-standalone"). */
 
67
    public static final String IS_STANDALONE_FEATURE = "is-standalone";
 
68
    
 
69
    /** Resolve DTD URIs feature ("resolve-dtd-uris"). */
 
70
    public static final String RESOLVE_DTD_URIS_FEATURE = "resolve-dtd-uris";
 
71
    
 
72
    /** Use Attributes2 feature ("use-attributes2"). */
 
73
    public static final String USE_ATTRIBUTES2_FEATURE = "use-attributes2";
 
74
    
 
75
    /** Use Locator2 feature ("use-locator2"). */
 
76
    public static final String USE_LOCATOR2_FEATURE = "use-locator2";
 
77
    
 
78
    /** Use EntityResolver2 feature ("use-entity-resolver2"). */
 
79
    public static final String USE_ENTITY_RESOLVER2_FEATURE = "use-entity-resolver2";
 
80
    
 
81
    /** Unicode normalization checking feature ("unicode-normalization-checking"). */
 
82
    public static final String UNICODE_NORMALIZATION_CHECKING_FEATURE = "unicode-normalization-checking";
 
83
    
 
84
    /** xmlns URIs feature ("xmlns-uris"). */
 
85
    public static final String XMLNS_URIS_FEATURE = "xmlns-uris";
 
86
    
 
87
    /** XML 1.1 feature ("xml-1.1"). */
 
88
    public static final String XML_11_FEATURE = "xml-1.1";
 
89
    
102
90
    /** Allow unparsed entity and notation declaration events to be sent after the end DTD event ("allow-dtd-events-after-endDTD") */
103
91
    public static final String ALLOW_DTD_EVENTS_AFTER_ENDDTD_FEATURE = "allow-dtd-events-after-endDTD";
104
 
 
 
92
    
105
93
    // sax properties
106
 
 
 
94
    
107
95
    /** SAX property prefix ("http://xml.org/sax/properties/"). */
108
96
    public static final String SAX_PROPERTY_PREFIX = "http://xml.org/sax/properties/";
109
 
 
 
97
    
110
98
    /** Declaration handler property ("declaration-handler"). */
111
99
    public static final String DECLARATION_HANDLER_PROPERTY = "declaration-handler";
112
 
 
 
100
    
113
101
    /** Lexical handler property ("lexical-handler"). */
114
102
    public static final String LEXICAL_HANDLER_PROPERTY = "lexical-handler";
115
 
 
 
103
    
116
104
    /** DOM node property ("dom-node"). */
117
105
    public static final String DOM_NODE_PROPERTY = "dom-node";
118
 
 
 
106
    
119
107
    /** XML string property ("xml-string"). */
120
108
    public static final String XML_STRING_PROPERTY = "xml-string";
121
 
 
122
 
 
 
109
    
 
110
    /** Document XML version property ("document-xml-version"). */
 
111
    public static final String DOCUMENT_XML_VERSION_PROPERTY = "document-xml-version";
 
112
    
 
113
    
123
114
    //
124
115
    // JAXP properties
125
116
    //
126
 
 
 
117
    
127
118
    /** JAXP property prefix ("http://java.sun.com/xml/jaxp/properties/"). */
128
119
    public static final String JAXP_PROPERTY_PREFIX =
129
 
            "http://java.sun.com/xml/jaxp/properties/";
130
 
 
 
120
        "http://java.sun.com/xml/jaxp/properties/";
 
121
    
131
122
    /** JAXP schemaSource property: when used internally may include DTD sources (DOM) */
132
123
    public static final String SCHEMA_SOURCE = "schemaSource";
133
 
 
 
124
    
134
125
    /** JAXP schemaSource language: when used internally may include DTD namespace (DOM) */
135
126
    public static final String SCHEMA_LANGUAGE = "schemaLanguage";
136
127
    
138
129
    //
139
130
    // DOM features
140
131
    //
141
 
 
 
132
    
142
133
    /** Comments feature ("include-comments"). */
143
134
    public static final String INCLUDE_COMMENTS_FEATURE = "include-comments";
144
 
 
 
135
    
145
136
    /** Create cdata nodes feature ("create-cdata-nodes"). */
146
137
    public static final String CREATE_CDATA_NODES_FEATURE = "create-cdata-nodes";
147
 
 
 
138
    
148
139
    /** Feature id: load as infoset. */
149
140
    public static final String LOAD_AS_INFOSET = "load-as-infoset";
150
 
 
151
 
 
 
141
    
 
142
    
152
143
    //
153
144
    // Constants: DOM Level 3 feature ids
154
145
    //
155
 
 
 
146
    
156
147
    public static final String DOM_CANONICAL_FORM = "canonical-form";
157
148
    public static final String DOM_CDATA_SECTIONS ="cdata-sections";
158
149
    public static final String DOM_COMMENTS = "comments"; 
159
 
 
 
150
    
160
151
    // REVISIT: this feature seems to have no effect for Xerces
161
152
    public static final String DOM_CHARSET_OVERRIDES_XML_ENCODING = 
162
 
    "charset-overrides-xml-encoding"; 
163
 
 
 
153
        "charset-overrides-xml-encoding"; 
 
154
    
164
155
    public static final String DOM_DATATYPE_NORMALIZATION = "datatype-normalization"; 
165
156
    public static final String DOM_ENTITIES = "entities";
166
157
    public static final String DOM_INFOSET = "infoset";  
167
158
    public static final String DOM_NAMESPACES = "namespaces";
168
159
    public static final String DOM_NAMESPACE_DECLARATIONS = "namespace-declarations";
169
160
    public static final String DOM_SUPPORTED_MEDIATYPES_ONLY =
170
 
    "supported-media-types-only";
171
 
 
 
161
        "supported-media-types-only";
 
162
    
172
163
    public static final String DOM_VALIDATE_IF_SCHEMA = "validate-if-schema";
173
164
    public static final String DOM_VALIDATE = "validate";
174
165
    public static final String DOM_ELEMENT_CONTENT_WHITESPACE =
175
 
    "element-content-whitespace";
176
 
 
 
166
        "element-content-whitespace";
 
167
    
177
168
    // DOM Level 3 features defined in Core:
178
169
    public static final String DOM_DISCARD_DEFAULT_CONTENT = "discard-default-content";
179
170
    public static final String DOM_NORMALIZE_CHARACTERS    = "normalize-characters";
180
171
    public static final String DOM_CHECK_CHAR_NORMALIZATION  = "check-character-normalization";
181
 
        public static final String DOM_WELLFORMED  = "well-formed";
 
172
    public static final String DOM_WELLFORMED  = "well-formed";
182
173
    public static final String DOM_SPLIT_CDATA = "split-cdata-sections";
183
 
 
 
174
    
184
175
    // Load and Save
185
176
    public static final String DOM_FORMAT_PRETTY_PRINT = "format-pretty-print";
186
177
    public static final String DOM_XMLDECL = "xml-declaration";
188
179
    public static final String DOM_CERTIFIED =  "certified";
189
180
    public static final String DOM_DISALLOW_DOCTYPE =  "disallow-doctype";
190
181
    public static final String DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS =  "ignore-unknown-character-denormalizations";
191
 
   
 
182
    
192
183
    // DOM Properties
193
184
    public static final String DOM_RESOURCE_RESOLVER = "resource-resolver";
194
185
    public static final String DOM_ERROR_HANDLER = "error-handler";
197
188
    
198
189
    // XSModel
199
190
    public static final String DOM_PSVI = "psvi";
200
 
 
201
 
 
 
191
    
 
192
    
202
193
    // xerces features
203
 
 
 
194
    
204
195
    /** Xerces features prefix ("http://apache.org/xml/features/"). */
205
196
    public static final String XERCES_FEATURE_PREFIX = "http://apache.org/xml/features/";
206
 
 
 
197
    
207
198
    /** Schema validation feature ("validation/schema"). */
208
199
    public static final String SCHEMA_VALIDATION_FEATURE = "validation/schema";
209
 
 
 
200
    
210
201
    /** Expose schema normalized values */
211
202
    public static final String SCHEMA_NORMALIZED_VALUE = "validation/schema/normalized-value";
212
 
 
 
203
    
213
204
    /** Send schema default value via characters() */
214
205
    public static final String SCHEMA_ELEMENT_DEFAULT = "validation/schema/element-default";
215
 
 
 
206
    
216
207
    /** Schema full constraint checking ("validation/schema-full-checking"). */
217
208
    public static final String SCHEMA_FULL_CHECKING = "validation/schema-full-checking";
218
 
 
 
209
    
219
210
    /** Augment Post-Schema-Validation-Infoset */
220
211
    public static final String SCHEMA_AUGMENT_PSVI = "validation/schema/augment-psvi";
221
 
 
 
212
    
222
213
    /** Dynamic validation feature ("validation/dynamic"). */
223
214
    public static final String DYNAMIC_VALIDATION_FEATURE = "validation/dynamic";
224
 
 
 
215
    
225
216
    /** Warn on duplicate attribute declaration feature ("validation/warn-on-duplicate-attdef"). */
226
217
    public static final String WARN_ON_DUPLICATE_ATTDEF_FEATURE = "validation/warn-on-duplicate-attdef";
227
 
 
 
218
    
228
219
    /** Warn on undeclared element feature ("validation/warn-on-undeclared-elemdef"). */
229
220
    public static final String WARN_ON_UNDECLARED_ELEMDEF_FEATURE = "validation/warn-on-undeclared-elemdef";
230
 
 
 
221
    
231
222
    /** Warn on duplicate entity declaration feature ("warn-on-duplicate-entitydef"). */
232
223
    public static final String WARN_ON_DUPLICATE_ENTITYDEF_FEATURE = "warn-on-duplicate-entitydef";
233
 
 
 
224
    
234
225
    /** Allow Java encoding names feature ("allow-java-encodings"). */
235
226
    public static final String ALLOW_JAVA_ENCODINGS_FEATURE = "allow-java-encodings";
236
 
 
 
227
    
237
228
    /** Disallow DOCTYPE declaration feature ("disallow-doctype-decl"). */
238
229
    public static final String DISALLOW_DOCTYPE_DECL_FEATURE = "disallow-doctype-decl";
239
 
 
 
230
    
240
231
    /** Continue after fatal error feature ("continue-after-fatal-error"). */
241
232
    public static final String CONTINUE_AFTER_FATAL_ERROR_FEATURE = "continue-after-fatal-error";
242
 
 
 
233
    
243
234
    /** Load dtd grammar when nonvalidating feature ("nonvalidating/load-dtd-grammar"). */
244
235
    public static final String LOAD_DTD_GRAMMAR_FEATURE = "nonvalidating/load-dtd-grammar";
245
 
 
 
236
    
246
237
    /** Load external dtd when nonvalidating feature ("nonvalidating/load-external-dtd"). */
247
238
    public static final String LOAD_EXTERNAL_DTD_FEATURE = "nonvalidating/load-external-dtd";
248
 
 
 
239
    
249
240
    /** Defer node expansion feature ("dom/defer-node-expansion"). */
250
241
    public static final String DEFER_NODE_EXPANSION_FEATURE = "dom/defer-node-expansion";
251
 
 
 
242
    
252
243
    /** Create entity reference nodes feature ("dom/create-entity-ref-nodes"). */
253
244
    public static final String CREATE_ENTITY_REF_NODES_FEATURE = "dom/create-entity-ref-nodes";
254
 
 
 
245
    
255
246
    /** Include ignorable whitespace feature ("dom/include-ignorable-whitespace"). */
256
247
    public static final String INCLUDE_IGNORABLE_WHITESPACE = "dom/include-ignorable-whitespace";
257
 
 
 
248
    
258
249
    /** Default attribute values feature ("validation/default-attribute-values"). */
259
250
    public static final String DEFAULT_ATTRIBUTE_VALUES_FEATURE = "validation/default-attribute-values";
260
 
 
 
251
    
261
252
    /** Validate content models feature ("validation/validate-content-models"). */
262
253
    public static final String VALIDATE_CONTENT_MODELS_FEATURE = "validation/validate-content-models";
263
 
 
 
254
    
264
255
    /** Validate datatypes feature ("validation/validate-datatypes"). */
265
256
    public static final String VALIDATE_DATATYPES_FEATURE = "validation/validate-datatypes";
266
 
 
 
257
    
 
258
    /** Balance syntax trees feature ("validation/balance-syntax-trees"). */
 
259
    public static final String BALANCE_SYNTAX_TREES = "validation/balance-syntax-trees";
 
260
    
267
261
    /** Notify character references feature (scanner/notify-char-refs"). */
268
262
    public static final String NOTIFY_CHAR_REFS_FEATURE = "scanner/notify-char-refs";
269
 
 
 
263
    
270
264
    /** Notify built-in (&amp;amp;, etc.) references feature (scanner/notify-builtin-refs"). */
271
265
    public static final String NOTIFY_BUILTIN_REFS_FEATURE = "scanner/notify-builtin-refs";
272
 
 
 
266
    
273
267
    /** Standard URI conformant feature ("standard-uri-conformant"). */
274
268
    public static final String STANDARD_URI_CONFORMANT_FEATURE = "standard-uri-conformant";
275
269
    
 
270
    /** Generate synthetic annotations feature ("generate-synthetic-annotations"). */
 
271
    public static final String GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE = "generate-synthetic-annotations";
 
272
    
 
273
    /** Validate annotations feature ("validate-annotations"). */
 
274
    public static final String VALIDATE_ANNOTATIONS_FEATURE = "validate-annotations";
 
275
    
 
276
    /** Honour all schemaLocations feature ("honour-all-schemaLocations"). */
 
277
    public static final String HONOUR_ALL_SCHEMALOCATIONS_FEATURE = "honour-all-schemaLocations";
 
278
    
 
279
    /** XInclude processing feature ("xinclude"). */
 
280
    public static final String XINCLUDE_FEATURE = "xinclude";
 
281
    
 
282
    /** XInclude fixup base URIs feature ("xinclude/fixup-base-uris"). */
 
283
    public static final String XINCLUDE_FIXUP_BASE_URIS_FEATURE = "xinclude/fixup-base-uris";
 
284
    
 
285
    /** XInclude fixup language feature ("xinclude/fixup-language"). */
 
286
    public static final String XINCLUDE_FIXUP_LANGUAGE_FEATURE = "xinclude/fixup-language";
 
287
    
 
288
    /**
 
289
     * Feature to ignore xsi:type attributes on elements during validation,
 
290
     * until a global element declaration is found. ("validation/schema/ignore-xsi-type-until-elemdecl")
 
291
     * If this feature is on when validating a document, then beginning at the validation root
 
292
     * element, xsi:type attributes are ignored until a global element declaration is
 
293
     * found for an element.  Once a global element declaration has been found, xsi:type
 
294
     * attributes will start being processed for the sub-tree beginning at the element for
 
295
     * which the declaration was found.
 
296
     * 
 
297
     * Suppose an element A has two element children, B and C.
 
298
     * 
 
299
     * If a global element declaration is found for A, xsi:type attributes on A, B and C,
 
300
     * and all of B and C's descendents, will be processed.
 
301
     * 
 
302
     * If no global element declaration is found for A or B, but one is found for C,
 
303
     * then xsi:type attributes will be ignored on A and B (and any descendents of B,
 
304
     * until a global element declaration is found), but xsi:type attributes will be
 
305
     * processed for C and all of C's descendents.
 
306
     * 
 
307
     * Once xsi:type attributes stop being ignored for a subtree, they do not start
 
308
     * being ignored again, even if more elements are encountered for which no global
 
309
     * element declaration can be found.
 
310
     */
 
311
    public static final String IGNORE_XSI_TYPE_FEATURE = "validation/schema/ignore-xsi-type-until-elemdecl";
 
312
    
 
313
    /** Perform checking of ID/IDREFs ("validation/id-idref-checking") */
 
314
    public static final String ID_IDREF_CHECKING_FEATURE = "validation/id-idref-checking";
 
315
    
 
316
    /** Feature to ignore errors caused by identity constraints ("validation/identity-constraint-checking") */
 
317
    public static final String IDC_CHECKING_FEATURE = "validation/identity-constraint-checking";
 
318
    
 
319
    /** Feature to ignore errors caused by unparsed entities ("validation/unparsed-entity-checking") */
 
320
    public static final String UNPARSED_ENTITY_CHECKING_FEATURE = "validation/unparsed-entity-checking";
 
321
    
 
322
    /**
 
323
     * Internal feature. When set to true the schema validator will only use
 
324
     * schema components from the grammar pool provided.
 
325
     */
 
326
    public static final String USE_GRAMMAR_POOL_ONLY_FEATURE = "internal/validation/schema/use-grammar-pool-only";
 
327
    
276
328
    /** Internal performance related feature: 
277
329
     * false - the parser settings (features/properties) have not changed between 2 parses
278
330
     * true - the parser settings have changed between 2 parses  
279
331
     * NOTE: this feature should only be set by the parser configuration.
280
332
     */
281
333
    public static final String PARSER_SETTINGS = "internal/parser-settings";
282
 
 
 
334
    
283
335
    // xerces properties
284
 
 
 
336
    
285
337
    /** Xerces properties prefix ("http://apache.org/xml/properties/"). */
286
338
    public static final String XERCES_PROPERTY_PREFIX = "http://apache.org/xml/properties/";
287
 
 
 
339
    
288
340
    /** Current element node property ("dom/current-element-node"). */
289
341
    public static final String CURRENT_ELEMENT_NODE_PROPERTY = "dom/current-element-node";
290
 
 
 
342
    
291
343
    /** Document class name property ("dom/document-class-name"). */
292
344
    public static final String DOCUMENT_CLASS_NAME_PROPERTY = "dom/document-class-name";
293
 
 
 
345
    
294
346
    /** Symbol table property ("internal/symbol-table"). */
295
347
    public static final String SYMBOL_TABLE_PROPERTY = "internal/symbol-table";
296
 
 
 
348
    
297
349
    /** Error reporter property ("internal/error-reporter"). */
298
350
    public static final String ERROR_REPORTER_PROPERTY = "internal/error-reporter";
299
 
 
 
351
    
300
352
    /** Error handler property ("internal/error-handler"). */
301
353
    public static final String ERROR_HANDLER_PROPERTY = "internal/error-handler";
302
 
 
 
354
    
303
355
    /** XInclude handler property ("internal/xinclude-handler"). */
304
356
    public static final String XINCLUDE_HANDLER_PROPERTY = "internal/xinclude-handler";
305
 
 
 
357
    
 
358
    /** XPointer handler property ("internal/xpointer-handler"). */
 
359
    public static final String XPOINTER_HANDLER_PROPERTY = "internal/xpointer-handler";
 
360
    
306
361
    /** Entity manager property ("internal/entity-manager"). */
307
362
    public static final String ENTITY_MANAGER_PROPERTY = "internal/entity-manager";
308
363
    
309
 
 
 
364
    
310
365
    /** Input buffer size property ("input-buffer-size"). */
311
366
    public static final String BUFFER_SIZE_PROPERTY = "input-buffer-size";
312
 
 
 
367
    
313
368
    /** Security manager property ("security-manager"). */
314
369
    public static final String SECURITY_MANAGER_PROPERTY = "security-manager";
315
 
 
 
370
    
316
371
    /** Entity resolver property ("internal/entity-resolver"). */
317
372
    public static final String ENTITY_RESOLVER_PROPERTY = "internal/entity-resolver";
318
 
 
 
373
    
319
374
    /** Grammar pool property ("internal/grammar-pool"). */
320
375
    public static final String XMLGRAMMAR_POOL_PROPERTY = "internal/grammar-pool";
321
 
 
 
376
    
322
377
    /** Datatype validator factory ("internal/datatype-validator-factory"). */
323
378
    public static final String DATATYPE_VALIDATOR_FACTORY_PROPERTY = "internal/datatype-validator-factory";
324
 
 
 
379
    
325
380
    /** Document scanner property ("internal/document-scanner"). */
326
381
    public static final String DOCUMENT_SCANNER_PROPERTY = "internal/document-scanner";
327
 
 
 
382
    
328
383
    /** DTD scanner property ("internal/dtd-scanner"). */
329
384
    public static final String DTD_SCANNER_PROPERTY = "internal/dtd-scanner";
330
 
 
 
385
    
331
386
    /** DTD processor property ("internal/dtd-processor"). */
332
387
    public static final String DTD_PROCESSOR_PROPERTY = "internal/dtd-processor";
333
 
 
 
388
    
334
389
    /** Validator property ("internal/validator"). */
335
390
    public static final String VALIDATOR_PROPERTY = "internal/validator";
336
 
 
 
391
    
337
392
    /** Validator property ("internal/validator/dtd"). */
338
393
    public static final String DTD_VALIDATOR_PROPERTY = "internal/validator/dtd";
339
 
 
 
394
    
340
395
    /** Validator property ("internal/validator/schema"). */
341
396
    public static final String SCHEMA_VALIDATOR_PROPERTY = "internal/validator/schema";
342
 
 
 
397
    
343
398
    /** No namespace schema location property ("schema/external-schemaLocation"). */
344
399
    public static final String SCHEMA_LOCATION = "schema/external-schemaLocation";
345
 
 
 
400
    
346
401
    /** Schema location property ("schema/external-noNamespaceSchemaLocation"). */
347
402
    public static final String SCHEMA_NONS_LOCATION = "schema/external-noNamespaceSchemaLocation";
348
403
    
349
404
    /** Namespace binder property ("internal/namespace-binder"). */
350
405
    public static final String NAMESPACE_BINDER_PROPERTY = "internal/namespace-binder";
351
 
 
 
406
    
352
407
    /** Namespace context property ("internal/namespace-context"). */
353
408
    public static final String NAMESPACE_CONTEXT_PROPERTY = "internal/namespace-context";
354
 
 
 
409
    
355
410
    /** Validation manager property ("internal/validation-manager"). */
356
411
    public static final String VALIDATION_MANAGER_PROPERTY = "internal/validation-manager";
357
 
 
 
412
    
 
413
    /** Schema type of the root element in a document ("validation/schema/root-type-definition"). */
 
414
    public static final String ROOT_TYPE_DEFINITION_PROPERTY = "validation/schema/root-type-definition";
 
415
    
358
416
    // general constants
359
 
 
 
417
    
360
418
    /** Element PSVI is stored in augmentations using string "ELEMENT_PSVI" */
361
419
    public final static String ELEMENT_PSVI = "ELEMENT_PSVI";
362
 
 
 
420
    
363
421
    /* Attribute PSVI is stored in augmentations using string "ATTRIBUTE_PSVI" */
364
422
    public final static String ATTRIBUTE_PSVI = "ATTRIBUTE_PSVI";
365
423
    
366
424
    /** 
367
425
     * Boolean indicating whether an attribute is declared in the DTD is stored 
368
 
     * in augmentations using string "ATTRIBUTE_DECLARED". The absence of this
 
426
     * in augmentations using the string "ATTRIBUTE_DECLARED". The absence of this
369
427
     * augmentation indicates that the attribute was not declared in the DTD.
370
428
     */
371
429
    public final static String ATTRIBUTE_DECLARED = "ATTRIBUTE_DECLARED";
372
 
 
 
430
    
 
431
    /** 
 
432
     * Boolean indicating whether an entity referenced in the document has
 
433
     * not been read is stored in augmentations using the string "ENTITY_SKIPPED". 
 
434
     * The absence of this augmentation indicates that the entity had a 
 
435
     * declaration and was expanded.
 
436
     */
 
437
    public final static String ENTITY_SKIPPED = "ENTITY_SKIPPED";
 
438
    
 
439
    /**
 
440
     * Boolean indicating whether a character is a probable white space
 
441
     * character (ch <= 0x20) that was the replacement text of a character 
 
442
     * reference is stored in augmentations using the string "CHAR_REF_PROBABLE_WS". 
 
443
     * The absence of this augmentation indicates that the character is not 
 
444
     * probable white space and/or was not included from a character reference.
 
445
     */
 
446
    public final static String CHAR_REF_PROBABLE_WS = "CHAR_REF_PROBABLE_WS";
 
447
    
373
448
    // XML version constants 
 
449
    public final static short XML_VERSION_ERROR = -1;
374
450
    public final static short XML_VERSION_1_0 = 1;
375
451
    public final static short XML_VERSION_1_1 = 2;
376
 
 
 
452
    
 
453
    // Constant to enable Schema 1.1 support
 
454
    public final static boolean SCHEMA_1_1_SUPPORT = false;
 
455
    
377
456
    // private
378
 
 
 
457
    
379
458
    /** SAX features. */
380
459
    private static final String[] fgSAXFeatures = {
381
 
        NAMESPACES_FEATURE,
382
 
        NAMESPACE_PREFIXES_FEATURE,
383
 
        STRING_INTERNING_FEATURE,
384
 
        VALIDATION_FEATURE,
385
 
        EXTERNAL_GENERAL_ENTITIES_FEATURE,
386
 
        EXTERNAL_PARAMETER_ENTITIES_FEATURE,
 
460
            NAMESPACES_FEATURE,
 
461
            NAMESPACE_PREFIXES_FEATURE,
 
462
            STRING_INTERNING_FEATURE,
 
463
            VALIDATION_FEATURE,
 
464
            EXTERNAL_GENERAL_ENTITIES_FEATURE,
 
465
            EXTERNAL_PARAMETER_ENTITIES_FEATURE,
387
466
    };
388
 
 
 
467
    
389
468
    /** SAX properties. */
390
469
    private static final String[] fgSAXProperties = {
391
 
        DECLARATION_HANDLER_PROPERTY,
392
 
        LEXICAL_HANDLER_PROPERTY,
393
 
        DOM_NODE_PROPERTY,
394
 
        XML_STRING_PROPERTY,
 
470
            DECLARATION_HANDLER_PROPERTY,
 
471
            LEXICAL_HANDLER_PROPERTY,
 
472
            DOM_NODE_PROPERTY,
 
473
            XML_STRING_PROPERTY,
395
474
    };
396
 
 
 
475
    
397
476
    /** Xerces features. */
398
477
    private static final String[] fgXercesFeatures = {
399
 
        SCHEMA_VALIDATION_FEATURE,
400
 
        SCHEMA_FULL_CHECKING,
401
 
        DYNAMIC_VALIDATION_FEATURE,
402
 
        WARN_ON_DUPLICATE_ATTDEF_FEATURE,
403
 
        WARN_ON_UNDECLARED_ELEMDEF_FEATURE,
404
 
        ALLOW_JAVA_ENCODINGS_FEATURE,
405
 
        CONTINUE_AFTER_FATAL_ERROR_FEATURE,
406
 
        LOAD_DTD_GRAMMAR_FEATURE,
407
 
        LOAD_EXTERNAL_DTD_FEATURE,
408
 
        //DEFER_NODE_EXPANSION_FEATURE,
409
 
        CREATE_ENTITY_REF_NODES_FEATURE,
410
 
        INCLUDE_IGNORABLE_WHITESPACE,
411
 
        //GRAMMAR_ACCESS_FEATURE,
412
 
        DEFAULT_ATTRIBUTE_VALUES_FEATURE,
413
 
        VALIDATE_CONTENT_MODELS_FEATURE,
414
 
        VALIDATE_DATATYPES_FEATURE,
415
 
        NOTIFY_CHAR_REFS_FEATURE,
416
 
        NOTIFY_BUILTIN_REFS_FEATURE,
417
 
        DISALLOW_DOCTYPE_DECL_FEATURE,
418
 
        STANDARD_URI_CONFORMANT_FEATURE
 
478
            SCHEMA_VALIDATION_FEATURE,
 
479
            SCHEMA_FULL_CHECKING,
 
480
            DYNAMIC_VALIDATION_FEATURE,
 
481
            WARN_ON_DUPLICATE_ATTDEF_FEATURE,
 
482
            WARN_ON_UNDECLARED_ELEMDEF_FEATURE,
 
483
            ALLOW_JAVA_ENCODINGS_FEATURE,
 
484
            CONTINUE_AFTER_FATAL_ERROR_FEATURE,
 
485
            LOAD_DTD_GRAMMAR_FEATURE,
 
486
            LOAD_EXTERNAL_DTD_FEATURE,
 
487
            //DEFER_NODE_EXPANSION_FEATURE,
 
488
            CREATE_ENTITY_REF_NODES_FEATURE,
 
489
            INCLUDE_IGNORABLE_WHITESPACE,
 
490
            //GRAMMAR_ACCESS_FEATURE,
 
491
            DEFAULT_ATTRIBUTE_VALUES_FEATURE,
 
492
            VALIDATE_CONTENT_MODELS_FEATURE,
 
493
            VALIDATE_DATATYPES_FEATURE,
 
494
            BALANCE_SYNTAX_TREES,
 
495
            NOTIFY_CHAR_REFS_FEATURE,
 
496
            NOTIFY_BUILTIN_REFS_FEATURE,
 
497
            DISALLOW_DOCTYPE_DECL_FEATURE,
 
498
            STANDARD_URI_CONFORMANT_FEATURE,
 
499
            GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE,
 
500
            VALIDATE_ANNOTATIONS_FEATURE,
 
501
            HONOUR_ALL_SCHEMALOCATIONS_FEATURE,
 
502
            XINCLUDE_FEATURE,
 
503
            XINCLUDE_FIXUP_BASE_URIS_FEATURE,
 
504
            XINCLUDE_FIXUP_LANGUAGE_FEATURE,
 
505
            IGNORE_XSI_TYPE_FEATURE,
 
506
            ID_IDREF_CHECKING_FEATURE,
 
507
            IDC_CHECKING_FEATURE,
 
508
            UNPARSED_ENTITY_CHECKING_FEATURE,
419
509
    };
420
 
 
 
510
    
421
511
    /** Xerces properties. */
422
512
    private static final String[] fgXercesProperties = {
423
 
        CURRENT_ELEMENT_NODE_PROPERTY,
424
 
        DOCUMENT_CLASS_NAME_PROPERTY,
425
 
        SYMBOL_TABLE_PROPERTY,
426
 
        ERROR_HANDLER_PROPERTY,
427
 
        ERROR_REPORTER_PROPERTY,
428
 
        ENTITY_MANAGER_PROPERTY,
429
 
        ENTITY_RESOLVER_PROPERTY,
430
 
        XMLGRAMMAR_POOL_PROPERTY,
431
 
        DATATYPE_VALIDATOR_FACTORY_PROPERTY,
432
 
        DOCUMENT_SCANNER_PROPERTY,
433
 
        DTD_SCANNER_PROPERTY,
434
 
        VALIDATOR_PROPERTY,
435
 
        SCHEMA_LOCATION,
436
 
        SCHEMA_NONS_LOCATION,
437
 
        VALIDATION_MANAGER_PROPERTY,
438
 
        BUFFER_SIZE_PROPERTY,
439
 
        SECURITY_MANAGER_PROPERTY
 
513
            CURRENT_ELEMENT_NODE_PROPERTY,
 
514
            DOCUMENT_CLASS_NAME_PROPERTY,
 
515
            SYMBOL_TABLE_PROPERTY,
 
516
            ERROR_HANDLER_PROPERTY,
 
517
            ERROR_REPORTER_PROPERTY,
 
518
            ENTITY_MANAGER_PROPERTY,
 
519
            ENTITY_RESOLVER_PROPERTY,
 
520
            XMLGRAMMAR_POOL_PROPERTY,
 
521
            DATATYPE_VALIDATOR_FACTORY_PROPERTY,
 
522
            DOCUMENT_SCANNER_PROPERTY,
 
523
            DTD_SCANNER_PROPERTY,
 
524
            VALIDATOR_PROPERTY,
 
525
            SCHEMA_LOCATION,
 
526
            SCHEMA_NONS_LOCATION,
 
527
            VALIDATION_MANAGER_PROPERTY,
 
528
            BUFFER_SIZE_PROPERTY,
 
529
            SECURITY_MANAGER_PROPERTY,
 
530
            ROOT_TYPE_DEFINITION_PROPERTY,
440
531
    };
441
 
 
 
532
    
442
533
    /** Empty enumeration. */
443
534
    private static final Enumeration fgEmptyEnumeration = new ArrayEnumeration(new Object[] {});
444
 
 
 
535
    
445
536
    //
446
537
    // Constructors
447
538
    //
448
 
 
 
539
    
449
540
    /** This class cannot be instantiated. */
450
541
    private Constants() {}
451
 
 
 
542
    
452
543
    //
453
544
    // Public methods
454
545
    //
455
 
 
 
546
    
456
547
    // sax
457
 
 
 
548
    
458
549
    /** Returns an enumeration of the SAX features. */
459
550
    public static Enumeration getSAXFeatures() {
460
551
        return fgSAXFeatures.length > 0
461
 
               ? new ArrayEnumeration(fgSAXFeatures) : fgEmptyEnumeration;
 
552
        ? new ArrayEnumeration(fgSAXFeatures) : fgEmptyEnumeration;
462
553
    } // getSAXFeatures():Enumeration
463
 
 
 
554
    
464
555
    /** Returns an enumeration of the SAX properties. */
465
556
    public static Enumeration getSAXProperties() {
466
557
        return fgSAXProperties.length > 0
467
 
               ? new ArrayEnumeration(fgSAXProperties) : fgEmptyEnumeration;
 
558
        ? new ArrayEnumeration(fgSAXProperties) : fgEmptyEnumeration;
468
559
    } // getSAXProperties():Enumeration
469
 
 
 
560
    
470
561
    // xerces
471
 
 
 
562
    
472
563
    /** Returns an enumeration of the Xerces features. */
473
564
    public static Enumeration getXercesFeatures() {
474
565
        return fgXercesFeatures.length > 0
475
 
               ? new ArrayEnumeration(fgXercesFeatures) : fgEmptyEnumeration;
 
566
        ? new ArrayEnumeration(fgXercesFeatures) : fgEmptyEnumeration;
476
567
    } // getXercesFeatures():Enumeration
477
 
 
 
568
    
478
569
    /** Returns an enumeration of the Xerces properties. */
479
570
    public static Enumeration getXercesProperties() {
480
571
        return fgXercesProperties.length > 0
481
 
               ? new ArrayEnumeration(fgXercesProperties) : fgEmptyEnumeration;
 
572
        ? new ArrayEnumeration(fgXercesProperties) : fgEmptyEnumeration;
482
573
    } // getXercesProperties():Enumeration
483
 
 
 
574
    
484
575
    //
485
576
    // Classes
486
577
    //
487
 
 
 
578
    
488
579
    /**
489
580
     * An array enumeration.
490
581
     *
491
582
     * @author Andy Clark, IBM
492
583
     */
493
584
    static class ArrayEnumeration
494
 
        implements Enumeration {
495
 
 
 
585
    implements Enumeration {
 
586
        
496
587
        //
497
588
        // Data
498
589
        //
499
 
 
 
590
        
500
591
        /** Array. */
501
592
        private Object[] array;
502
 
 
 
593
        
503
594
        /** Index. */
504
595
        private int index;
505
 
 
 
596
        
506
597
        //
507
598
        // Constructors
508
599
        //
509
 
 
 
600
        
510
601
        /** Constructs an array enumeration. */
511
602
        public ArrayEnumeration(Object[] array) {
512
603
            this.array = array;
513
604
        } // <init>(Object[])
514
 
 
 
605
        
515
606
        //
516
607
        // Enumeration methods
517
608
        //
518
 
 
 
609
        
519
610
        /**
520
611
         * Tests if this enumeration contains more elements.
521
612
         *
526
617
        public boolean hasMoreElements() {
527
618
            return index < array.length;
528
619
        } // hasMoreElement():boolean
529
 
 
 
620
        
530
621
        /**
531
622
         * Returns the next element of this enumeration.
532
623
         *
540
631
            }
541
632
            throw new NoSuchElementException();
542
633
        } // nextElement():Object
543
 
 
 
634
        
544
635
    } // class ArrayEnumeration
545
 
 
 
636
    
546
637
    //
547
638
    // MAIN
548
639
    //
549
 
 
 
640
    
550
641
    /** Prints all of the constants to standard output. */
551
642
    public static void main(String[] argv) {
552
 
 
 
643
        
553
644
        print("SAX features:", SAX_FEATURE_PREFIX, fgSAXFeatures);
554
645
        print("SAX properties:", SAX_PROPERTY_PREFIX, fgSAXProperties);
555
646
        print("Xerces features:", XERCES_FEATURE_PREFIX, fgXercesFeatures);
556
647
        print("Xerces properties:", XERCES_PROPERTY_PREFIX, fgXercesProperties);
557
 
 
 
648
        
558
649
    } // main(String[])
559
 
 
 
650
    
560
651
    /** Prints a list of features/properties. */
561
652
    private static void print(String header, String prefix, Object[] array) {
562
653
        System.out.print(header);
572
663
            System.out.println(" none.");
573
664
        }
574
665
    } // print(String,String,Object[])
575
 
 
 
666
    
576
667
} // class Constants