File: faq-xni.xml

package info (click to toggle)
libxerces2-java 2.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 12,596 kB
  • sloc: java: 127,777; xml: 13,728; sh: 39; makefile: 10
file content (171 lines) | stat: -rw-r--r-- 7,500 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?xml version='1.0' encoding='UTF-8'?>
<!--
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->
<!DOCTYPE faqs SYSTEM 'dtd/faqs.dtd'>
<faqs title='Xerces Native Interface FAQs'>
  <faq title="Augmentations">
    <q>What are all these strange &quot;Augmentations&quot; parameters I see in so many methods?</q>
    <a>
        <p> They&apos;re intended to provide a way to augment the
        basic XML infoset available from the non-Augmentation
        parameters in the callbacks.  They can be used by a component to add arbitrary
        information to the streaming infoset, which can then
        be interpreted by some later component.</p>
        <p> For instance, a component can be written to transmit the
        post schema validation infoset through Augmentations
        callbacks.  This can then be translated into an XML
        representation.  This is exactly what is done in the PSVI
        Writer and PSVI Configuration samples--see <link
        idref="samples-xni">XNI sample documentation</link> for
        details.</p>
    </a>
 </faq>
 <faq title='Overriding Default Parser Configuration'>
  <q>How do I change the default parser configuration?</q>
  <a>
   <anchor name="override-default-config"/>
   <p>
    It is possible to override the default parser configuration used
    by the Xerces2 parsers without writing any code or changing the
    existing parser classes. Moreover, the DOM and SAX parsers created
    using the JAXP interfaces will use the specified parser configuration
    transparently and without need to call additional methods to set the
    parser configuration.
   </p>
   <p>
    The DOM and SAX parsers decide which parser configuration to use in
    the following order:
   </p>
   <ol>
    <li>
     First, the <code>org.apache.xerces.xni.parser.XMLParserConfiguration</code>
     system property is queried for the class name of the parser configuration.
    </li>
    <li>
     Next, if a file called <code>xerces.properties</code> exists in the lib
     subdirectory of the JRE installation and the 
     <code>org.apache.xerces.xni.parser.XMLParserConfiguration</code> property
     is defined it, then its value will be read from the file.
    </li>
    <li>
     Next, the <code>org.apache.xerces.xni.parser.XMLParserConfiguration</code>
     file is requested from the <code>META-INF/services/</code> directory. 
     This file contains the class name of the parser configuration.
    </li>
    <li>
     Finally, the <code>&DefaultConfigLong;</code>
     is used as the default parser configuration.
    </li>
   </ol>
   <note>
    In all cases, the parser configuration class must have a public,
    no argument constructor so that it can be instantiated dynamically.
   </note>
   <p>
    When using Java 2, it is not necessary to rebuild the Xerces jar files
    in order to override the default parser configuration using the first
    method. As long as a JAR file containing the appropriate file exists
    in the <code>META-INF/services/</code> directory appears <em>before</em>
    the Xerces JAR files, the parser will use the new parser configuration.
   </p>
   <p>
    The first method can always be used on the command line for the JVM
    by using the <code>-D</code> option. For example, to override the
    default parser configuration using a custom configuration named
    <code>MyConfig</code>, use the following command line:
   </p>
   <source>java -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=MyConfig application_class</source>
  </a>
 </faq>
 <faq title="Xerces Parser Configurations">
  <q>In the Xerces distribution, what are the available parser configurations?</q>
  <a>
   <p>
    The default parser configuration is <code>&DefaultConfigLong;</code>. It
    and the other available parser configurations are described in the table 
    below. All of them are located in the <code>org.apache.xerces.parsers</code>
    package.
   </p>
   <table>
    <tr><th>Configuration</th><th>Description</th></tr>
    <tr>
     <td>DTDConfiguration</td>
     <td>A DTD-only configuration. Contains components appropriate to DTD-centric validation.</td>
    </tr>
    <tr>
     <td>IntegratedParserConfiguration</td>
     <td>Extends StandardParserConfiguration by including a scanner that integrates 
         both scanning of the document and binding namespaces.</td>
    </tr>
    <tr>
     <td>NonValidatingConfiguration</td>
     <td>A non-validating configuration. It does not provide a
         <jump href="http://www.w3.org/TR/2006/REC-xml-20060816/#sec-conformance">conformant</jump>
         non-validating XML processor because it does not process the declarations
         in an internal subset besides checking their well-formedness.
     </td>
    </tr>
    <tr>
     <td>SecurityConfiguration</td>
     <td>Extends the default configuration allowing Xerces to behave in a more
         security conscious manner by installing a 
         <link idref='properties' anchor='security-manager'>SecurityManager</link>.
     </td>
    </tr>
    <tr>
     <td>SoftReferenceSymbolTableConfiguration</td>
     <td>Extends the default configuration allowing Xerces to handle usage scenarios
         where the names in the XML documents being parsed are mostly unique by
         installing a memory sensitive SymbolTable. The internalized strings stored
         in this SymbolTable are softly reachable and may be cleared by the garbage
         collector in response to memory demand.
     </td>
    </tr>
    <tr>
     <td>StandardParserConfiguration</td>
     <td>Extends DTDConfiguration by adding support for XML schema validation.</td>
    </tr>
    <tr>
     <td>XIncludeAwareParserConfiguration</td>
     <td>Extends XML11Configuration by providing support 
         for XInclude. See the XInclude <link idref='faq-xinclude'>FAQ</link>.
     </td>
    </tr>
    <tr>
     <td>XML11Configuration</td>
     <td>Like IntegratedParserConfiguration except that it supports XML 1.1
         in addition to XML 1.0.
     </td>
    </tr>
    <tr>
     <td>XML11DTDConfiguration</td>
     <td>Like DTDConfiguration except that it supports XML 1.1 in addition to XML 1.0.</td>
    </tr>
    <tr>
     <td>XML11NonValidatingConfiguration</td>
     <td>Like NonValidatingConfiguration except that it supports XML 1.1 in addition to XML 1.0.</td>
    </tr>
    <tr>
     <td>XMLGrammarCachingConfiguration</td>
     <td>Extends the default configuration by providing a generic
         way of using Xerces' grammar caching facilities.
     </td>
    </tr>
   </table>
  </a>
 </faq>
</faqs>