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

« back to all changes in this revision

Viewing changes to docs/features.xml

  • 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
<?xml version='1.0' encoding='UTF-8'?>
 
2
<!--
 
3
 * Copyright 1999-2006 The Apache Software Foundation.
 
4
 *
 
5
 * Licensed under the Apache License, Version 2.0 (the "License");
 
6
 * you may not use this file except in compliance with the License.
 
7
 * You may obtain a copy of the License at
 
8
 *
 
9
 *     http://www.apache.org/licenses/LICENSE-2.0
 
10
 *
 
11
 * Unless required by applicable law or agreed to in writing, software
 
12
 * distributed under the License is distributed on an "AS IS" BASIS,
 
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
14
 * See the License for the specific language governing permissions and
 
15
 * limitations under the License.
 
16
-->
2
17
<!DOCTYPE features SYSTEM 'dtd/settings.dtd'>
3
18
<features>
4
19
 <desc name='Setting Features'>
5
20
  <p>
6
21
   If you have created a DOM document builder or a SAX parser using
7
 
   the JAXP interfaces, you may have difficulty setting features and
8
 
   properties directly using those interfaces. The following
9
 
   instructions tell you how to set features on document builders
10
 
   and SAX parsers created from the JAXP interfaces.
 
22
   the JAXP interfaces, the following instructions tell you how to
 
23
   set features on document builders and SAX parsers created from
 
24
   the JAXP interfaces.
11
25
  </p>
12
26
  <p>
13
27
   The DocumentBuilderFactory interface contains a 
14
 
   <code>setAttribute(String,Object)</code> method which <em>may</em>
15
 
   provide a means to set features and properties on the underyling
16
 
   parser. However, it cannot be relied upon. Therefore, you must
17
 
   use the Xerces DOMParser object directly. For example:
 
28
   <code>setFeature(String,boolean)</code> method which 
 
29
   can be used to set features on the underlying parser.
 
30
   For example:
18
31
  </p>
19
 
  <source>import org.apache.xerces.parsers.DOMParser;
20
 
import org.xml.sax.SAXException;
 
32
  <source>import javax.xml.parsers.DocumentBuilderFactory;
 
33
import javax.xml.parsers.DocumentBuilder;
21
34
  
22
 
DOMParser parser = new DOMParser();
 
35
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
 
36
dbf.setNamespaceAware(true);
 
37
 
23
38
try {
24
 
    parser.setFeature("http://apache.org/xml/features/allow-java-encodings", 
25
 
                      true);
 
39
    dbf.setFeature("http://apache.org/xml/features/allow-java-encodings", 
 
40
                   true);
26
41
27
 
catch (SAXException e) {
 
42
catch (ParserConfigurationException e) {
28
43
    System.err.println("could not set parser feature");
29
44
}</source>
30
45
  <p>
31
 
   Using the SAXParser interface in JAXP is better because you can
32
 
   query the underlying XMLReader implementation directly and that
33
 
   interface contains methods to set and query features and 
34
 
   properties. For example:
 
46
   The SAXParserFactory interface contains a
 
47
   <code>setFeature(String,boolean)</code> method which can be used
 
48
   to set features on the underlying implementation of <code>XMLReader</code>.
 
49
   Once you create the SAXParser you can retrieve the underlying
 
50
   <code>XMLReader</code> allowing you to set and query features on it directly.
 
51
   For example:
35
52
  </p>
36
53
  <source>import javax.xml.parsers.SAXParser;
37
54
import org.xml.sax.SAXException;
68
85
   <see idref='namespace-prefixes'/>
69
86
   <see idref='validation'/>
70
87
  </feature>
 
88
  <feature name='http://xml.org/sax/features/use-entity-resolver2'
 
89
           id='use-entity-resolver2'>
 
90
   <true>
 
91
    The methods of the org.xml.sax.ext.EntityResolver2 interface will be used when an object implementing
 
92
    this interface is registered with the parser using setEntityResolver.
 
93
   </true>
 
94
   <false>
 
95
    The methods of the org.xml.sax.ext.EntityResolver2 interface will not be used.
 
96
   </false>
 
97
   <default value='true'/>
 
98
   <access general='read-write'/>
 
99
   <since value='&ParserName; 2.7.0'/>
 
100
   <note>
 
101
    If the <link anchor="disallow-doctype-decl">disallow DOCTYPE declaration</link> feature is set to true
 
102
    org.xml.sax.ext.EntityResolver2.getExternalSubset() will not be called when the document contains no
 
103
    DOCTYPE declaration.
 
104
   </note>
 
105
   <see idref='disallow-doctype-decl'/>
 
106
   <see idref='validation'/>
 
107
   <see idref='nonvalidating.load-external-dtd'/>
 
108
  </feature>
71
109
  <feature name='http://xml.org/sax/features/validation' 
72
110
           id='validation'>
73
111
   <true>Validate the document and report validity errors.</true>
100
138
  </feature>
101
139
  <feature name='http://apache.org/xml/features/validation/schema'
102
140
           id='validation.schema'>
103
 
   <true>Turn on XML Schema validation by inserting XML Schema validator in the pipeline.
 
141
   <true>Turn on XML Schema validation by inserting an XML Schema validator into the pipeline.
104
142
   </true>
105
143
   <false>Do not report validation errors against XML Schema.</false>
106
144
   <default value='false'/>   
107
145
   <access parsing='read-only' not-parsing='read-write'/>
108
 
   <note> Validation errors will only be reported if <link anchor="validation">validation feature</link> is set to true. For more information, please, refer to the <link idref='faq-pcfp'>FAQ</link>
 
146
   <note> Validation errors will only be reported if the <link anchor="validation">validation feature</link> is set to true. For more information, please, refer to the <link idref='faq-pcfp'>FAQ</link>
 
147
   </note>
 
148
   <note> 
 
149
    Checking of constraints on a schema grammar which are either time-consuming or memory intensive
 
150
    such as unique particle attribution will only occur if the
 
151
    <link anchor="validation.schema-full-checking">schema full checking feature</link> is set to true.
109
152
   </note>  
110
153
   <see idref='validation'/>
111
154
   <see idref='validation.dynamic'/>
115
158
           id='validation.schema-full-checking'>
116
159
   <true>
117
160
    Enable full schema grammar constraint checking, including checking 
118
 
    which may be time-consuming or memory intensive. Currently, particle 
119
 
    unique attribution constraint checking and particle derivation 
120
 
    resriction checking are controlled by this option. 
 
161
    which may be time-consuming or memory intensive. Currently, unique
 
162
    particle attribution constraint checking and particle derivation 
 
163
    restriction checking are controlled by this option. 
121
164
   </true>
122
165
   <false>Disable full constraint checking.</false>
123
166
   <default value='false'/>
172
215
   <see idref='validation.schema'/> 
173
216
  </feature>
174
217
  
 
218
  <feature name='http://apache.org/xml/features/validation/schema/ignore-xsi-type-until-elemdecl'
 
219
           id='validation.schema.ignore-xsi-type-until-elemdecl'>
 
220
   <true>xsi:type attributes will be ignored until a global element declaration has been found, at which point xsi:type attributes will be processed on the element for which the global element declaration was found as well as its descendants.</true>
 
221
   <false>Do not ignore xsi:type attributes.</false>
 
222
   <default value='false'/>
 
223
   <access parsing='read-only' not-parsing='read-write'/>
 
224
   <since value='&ParserName; 2.8.0'/>
 
225
   <see idref='validation'/>
 
226
   <see idref='validation.schema'/>
 
227
  </feature>
 
228
  
 
229
  <feature name='http://apache.org/xml/features/generate-synthetic-annotations'
 
230
           id='generate-synthetic-annotations'>
 
231
   <true>Enable generation of synthetic annotations. A synthetic annotation will be generated when a schema component has non-schema attributes but no child annotation.</true>
 
232
   <false>Do not generate synthetic annotations.</false>
 
233
   <default value='false'/>
 
234
   <access parsing='read-only' not-parsing='read-write'/>
 
235
   <since value='&ParserName; 2.7.0'/>
 
236
   <see idref='validation'/>
 
237
   <see idref='validation.schema'/>
 
238
   <see idref='validate-annotations'/>
 
239
  </feature>
 
240
  
 
241
  <feature name='http://apache.org/xml/features/validate-annotations'
 
242
           id='validate-annotations'>
 
243
   <true>Schema annotations will be laxly validated against available schema components.</true>
 
244
   <false>Do not validate schema annotations.</false>
 
245
   <default value='false'/>
 
246
   <access parsing='read-only' not-parsing='read-write'/>
 
247
   <since value='&ParserName; 2.7.0'/>
 
248
   <see idref='validation'/>
 
249
   <see idref='validation.schema'/>
 
250
   <see idref='generate-synthetic-annotations'/>
 
251
  </feature>
 
252
  
 
253
  <feature name='http://apache.org/xml/features/honour-all-schemaLocations'
 
254
           id='honour-all-schemaLocations'>
 
255
    <true>All schema location hints will be used to locate the components for a given target namespace.</true>
 
256
    <false>Only the first schema location hint encountered by the processor will be used to locate the components for a given target namespace.</false>
 
257
    <default value='false'/>
 
258
    <access parsing='read-only' not-parsing='read-write'/>
 
259
    <since value='&ParserName; 2.7.0'/>
 
260
  </feature>
175
261
 
176
262
  <feature name='http://xml.org/sax/features/external-general-entities'
177
263
           id='external-general-entities'>
193
279
   <access parsing='read-only' not-parsing='read-write'/>
194
280
   <see idref='external-general-entities'/>
195
281
  </feature>
 
282
  <feature name='http://apache.org/xml/features/validation/balance-syntax-trees'
 
283
           id='validation.balance-syntax-trees'>
 
284
   <true>Construct an optimal representation for DTD content models to significantly 
 
285
         reduce the likelihood a StackOverflowError will occur when large content 
 
286
         models are processed.</true>
 
287
   <false>
 
288
    Do not invest processing time to construct an optimal representation for DTD content models.
 
289
   </false>
 
290
   <default value='false'/>
 
291
   <access parsing='read-only' not-parsing='read-write'/>
 
292
   <since value='&ParserName; 2.8.0'/>
 
293
   <note>
 
294
    Enabling this feature may cost your application some performance when DTDs are 
 
295
    processed so it is recommended that it only be turned on when necessary.
 
296
   </note>
 
297
  </feature>
 
298
  <feature name='http://apache.org/xml/features/validation/id-idref-checking'
 
299
           id='validation.id-idref-checking'>
 
300
   <true>Enable checking of ID/IDREF constraints.</true>
 
301
   <false>
 
302
    Disable checking of ID/IDREF constraints. Validation will not fail if 
 
303
    there are non-unique ID values or dangling IDREF values in the document.
 
304
   </false>
 
305
   <default value='true'/>
 
306
   <access parsing='read-only' not-parsing='read-write'/>
 
307
   <since value='&ParserName; 2.8.0'/>
 
308
   <note>This feature only applies to schema validation.</note>
 
309
   <see idref='validation'/>
 
310
   <see idref='validation.schema'/>
 
311
  </feature>
 
312
  <feature name='http://apache.org/xml/features/validation/identity-constraint-checking'
 
313
           id='validation.identity-constraint-checking'>
 
314
   <true>Enable identity constraint checking.</true>
 
315
   <false>Disable identity constraint checking.</false>
 
316
   <default value='true'/>
 
317
   <access parsing='read-only' not-parsing='read-write'/>
 
318
   <since value='&ParserName; 2.8.0'/>
 
319
   <see idref='validation'/>
 
320
   <see idref='validation.schema'/>
 
321
  </feature>
 
322
  <feature name='http://apache.org/xml/features/validation/unparsed-entity-checking'
 
323
           id='validation.unparsed-entity-checking'>
 
324
   <true>Check that each value of type ENTITY matches the name of an unparsed entity declared in the DTD.</true>
 
325
   <false>Do not check that each value of type ENTITY matches the name of an unparsed entity declared in the DTD.</false>
 
326
   <default value='true'/>
 
327
   <access parsing='read-only' not-parsing='read-write'/>
 
328
   <since value='&ParserName; 2.8.0'/>
 
329
   <note>This feature only applies to schema validation.</note>
 
330
   <see idref='validation'/>
 
331
   <see idref='validation.schema'/>
 
332
  </feature>
196
333
  <feature name='http://apache.org/xml/features/validation/warn-on-duplicate-attdef'
197
334
           id='validation.warn-on-duplicate-attdef'>
198
335
   <true>Report a warning when a duplicate attribute is re-declared.</true>
305
442
   </true>
306
443
   <false>DOCTYPE declaration is allowed.</false>
307
444
   <default value='false'/>
 
445
   <since value='&ParserName; 2.3.0'/>
308
446
  </feature>
309
447
 
310
448
  <feature name='http://apache.org/xml/features/standard-uri-conformant'
317
455
    invalid URI characters (space, for example).
318
456
   </false>
319
457
   <default value='false'/>
 
458
   <since value='&ParserName; 2.3.0'/>
320
459
   <note>
321
460
    It's recommended to set this feature to true if you want your
322
461
    application/documents to be truly portable across different XML processors.
323
462
   </note>
324
463
  </feature>
 
464
  
 
465
  <feature name='http://apache.org/xml/features/xinclude'
 
466
           id='xinclude'>
 
467
   <true>Enable XInclude processing.</true>
 
468
   <false>Do not perform XInclude processing.</false>
 
469
   <default value='false'/>
 
470
   <since value='&ParserName; 2.7.0'/>
 
471
   <see idref='xinclude.fixup-base-uris'/>
 
472
   <see idref='xinclude.fixup-language'/>
 
473
  </feature>
 
474
  
 
475
  <feature name='http://apache.org/xml/features/xinclude/fixup-base-uris'
 
476
           id='xinclude.fixup-base-uris'>
 
477
   <true>Perform base URI fixup as specified by the XInclude Recommendation.</true>
 
478
   <false>Do not perform base URI fixup. The XInclude processor will not add xml:base attributes.</false>
 
479
   <default value='true'/>
 
480
   <since value='&ParserName; 2.7.0'/>
 
481
   <see idref='xinclude'/>
 
482
  </feature>
 
483
  
 
484
  <feature name='http://apache.org/xml/features/xinclude/fixup-language'
 
485
           id='xinclude.fixup-language'>
 
486
   <true>Perform language fixup as specified by the XInclude Recommendation.</true>
 
487
   <false>Do not perform language fixup. The XInclude processor will not add xml:lang attributes.</false>
 
488
   <default value='true'/>
 
489
   <since value='&ParserName; 2.7.0'/>
 
490
   <see idref='xinclude'/>
 
491
  </feature>
325
492
 </fcategory>
326
493
 
327
494
 <fcategory name='DOM Features'>
334
501
    Fully expand the DOM nodes.
335
502
   </false>
336
503
   <default value='true**'/>
337
 
   <note>In the <code>DOMBuilder</code> implementation the default value of 
 
504
   <note>In the <code>LSParser</code> implementation the default value of 
338
505
    this feature is <strong>false</strong>. 
339
506
   </note>
340
507
   <note>
361
528
   <false>
362
529
    Do not create <code>EntityReference</code> nodes in the DOM tree. 
363
530
    No <code>EntityReference</code> nodes will be created, only the 
364
 
    nodes corresponding to their fully expanded sustitution text will 
 
531
    nodes corresponding to their fully expanded substitution text will 
365
532
    be created.  
366
533
   </false>
367
534
   <default value='true'/>
385
552
    the document. When ignorable whitespace text nodes are included in 
386
553
    the DOM tree, they will be flagged as ignorable. The ignorable flag
387
554
    can be queried by calling the 
388
 
    <code>TextImpl#isIgnorableWhitespace():boolean</code> method. 
 
555
    <code>Text#isElementContentWhitespace():boolean</code> method. 
389
556
    This feature is relevant only when the grammar is <strong>DTD</strong>. 
390
557
   </note>
391
558
  </feature>
420
587
    can only be set to true.
421
588
   </note>
422
589
  </feature>
 
590
  <feature name='http://xml.org/sax/features/lexical-handler/parameter-entities'
 
591
           id='lexical-handler.parameter-entities'>
 
592
   <true>
 
593
    Report the beginning and end of parameter entities to a registered LexicalHandler.
 
594
   </true>
 
595
   <false>
 
596
    Do not report the beginning and end of parameter entities to a registered LexicalHandler.
 
597
   </false>
 
598
   <default value='true'/>
 
599
   <since value='&ParserName; 2.7.0'/>
 
600
  </feature>
 
601
  <feature name='http://xml.org/sax/features/is-standalone'
 
602
           id='is-standalone'>
 
603
   <true>
 
604
    The document specified standalone="yes" in its XML declaration.
 
605
   </true>
 
606
   <false>
 
607
    The document specified standalone="no" in its XML declaration or the 
 
608
    standalone document declaration was absent.
 
609
   </false>
 
610
   <access parsing='read-only' not-parsing='none'/>
 
611
   <since value='&ParserName; 2.7.0'/>
 
612
  </feature>
 
613
  <feature name='http://xml.org/sax/features/resolve-dtd-uris'
 
614
           id='resolve-dtd-uris'>
 
615
   <true>
 
616
    The system identifiers passed to the notationDecl, unparsedEntityDecl, and 
 
617
    externalEntityDecl events will be absolutized relative to their base URIs before reporting.
 
618
   </true>
 
619
   <false>
 
620
    System identifiers in declarations will not be absolutized before reporting.
 
621
   </false>
 
622
   <default value='true'/>
 
623
   <since value='&ParserName; 2.7.0'/>
 
624
   <note>
 
625
    This feature does not apply to EntityResolver.resolveEntity(), which is not used to report declarations, 
 
626
    or to LexicalHandler.startDTD(), which already provides the non-absolutized URI.
 
627
   </note>
 
628
  </feature>
 
629
  <feature name='http://xml.org/sax/features/unicode-normalization-checking'
 
630
           id='unicode-normalization-checking'>
 
631
   <true>
 
632
    Perform Unicode normalization checking (as described in section 2.13 and Appendix B 
 
633
    of the XML 1.1 Recommendation) and report normalization errors.
 
634
   </true>
 
635
   <false>
 
636
    Do not report Unicode normalization errors.
 
637
   </false>
 
638
   <default value='false'/>
 
639
   <since value='&ParserName; 2.7.0'/>
 
640
   <note>
 
641
    As there is currently no support for Unicode normalization checking, this 
 
642
    feature can only be set to false.
 
643
   </note>
 
644
  </feature>
 
645
  <feature name='http://xml.org/sax/features/use-attributes2'
 
646
           id='use-attributes2'>
 
647
   <true>
 
648
    The Attributes objects passed by the parser in org.xml.sax.ContentHandler.startElement() implement the org.xml.sax.ext.Attributes2 interface.
 
649
   </true>
 
650
   <false>
 
651
    The Attributes objects passed by the parser do not implement the org.xml.sax.ext.Attributes2 interface.
 
652
   </false>
 
653
   <access general='read-only'/>
 
654
   <since value='&ParserName; 2.7.0'/>
 
655
   <note>
 
656
    Xerces-J will always report Attributes objects that also implement org.xml.sax.ext.Attributes2
 
657
    so the value of this feature will always be true.
 
658
   </note>
 
659
  </feature>
 
660
  <feature name='http://xml.org/sax/features/use-locator2'
 
661
           id='use-locator2'>
 
662
   <true>
 
663
    The Locator objects passed by the parser in org.xml.sax.ContentHandler.setDocumentLocator() implement the org.xml.sax.ext.Locator2 interface.
 
664
   </true>
 
665
   <false>
 
666
    The Locator objects passed by the parser do not implement the org.xml.sax.ext.Locator2 interface.
 
667
   </false>
 
668
   <access general='read-only'/>
 
669
   <since value='&ParserName; 2.7.0'/>
 
670
   <note>
 
671
    Xerces-J will always report Locator objects that also implement org.xml.sax.ext.Locator2
 
672
    so the value of this feature will always be true.
 
673
   </note>
 
674
  </feature>
 
675
  <feature name='http://xml.org/sax/features/xmlns-uris'
 
676
           id='xmlns-uris'>
 
677
   <true>
 
678
    When the namespace-prefixes feature is set to true, namespace declaration attributes
 
679
    will be reported as being in the http://www.w3.org/2000/xmlns/ namespace.
 
680
   </true>
 
681
   <false>
 
682
    Namespace declaration attributes are reported as having no namespace.
 
683
   </false>
 
684
   <default value='false'/>
 
685
   <since value='&ParserName; 2.7.0'/>
 
686
   <see idref='namespaces'/>
 
687
   <see idref='namespace-prefixes'/>
 
688
  </feature>
 
689
  <feature name='http://xml.org/sax/features/xml-1.1'
 
690
           id='xml-1.1'>
 
691
   <true>
 
692
    The parser supports both XML 1.1 and XML 1.0.
 
693
   </true>
 
694
   <false>
 
695
    The parser supports only XML 1.0.
 
696
   </false>
 
697
   <access general='read-only'/>
 
698
   <since value='&ParserName; 2.7.0'/>
 
699
   <note>
 
700
    The value of this feature will depend on whether the
 
701
    parser configuration owned by the SAX parser is known
 
702
    to support XML 1.1.
 
703
   </note>
 
704
  </feature>
 
705
  
423
706
 </fcategory>
424
707
 <fcategory name='XInclude Features (Experimental)'>
425
708
   <feature name='http://xml.org/sax/features/allow-dtd-events-after-endDTD'
433
716
    are not sent after the <code>endDTD</code> event has been sent (default SAX behaviour).
434
717
   </false>
435
718
   <default value='true**'/>
 
719
   <since value='&ParserName; 2.5.0'/>
436
720
   <note>
437
721
    The default value for this feature is true, except when using SAX,
438
722
    because SAX requires that no DTD events be sent after the <code>endDTD</code>
451
735
   <note>
452
736
    This feature is currently experimental, and might be removed or changed in the
453
737
    next release. If you have any concerns or suggestions about its use, please
454
 
    contact the xerces-j-user mailing list.
 
738
    contact the j-users@xerces.apache.org mailing list.
455
739
   </note>
456
740
  </feature>
457
741
 </fcategory>