2 <!-- $Id: package.html,v 1.1 2004/12/23 22:38:42 mark Exp $ -->
5 <p> This package provides the core SAX APIs.
6 Some SAX1 APIs are deprecated to encourage integration of
7 namespace-awareness into designs of new applications
8 and into maintenance of existing infrastructure. </p>
10 <p>See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
11 for more information about SAX.</p>
14 <h2> SAX2 Standard Feature Flags </h2>
16 <p> One of the essential characteristics of SAX2 is that it added
17 feature flags which can be used to examine and perhaps modify
18 parser modes, in particular modes such as validation.
19 Since features are identified by (absolute) URIs, anyone
20 can define such features.
21 Currently defined standard feature URIs have the prefix
22 <code>http://xml.org/sax/features/</code> before an identifier such as
23 <code>validation</code>. Turn features on or off using
24 <em>setFeature</em>. Those standard identifiers are: </p>
27 <table border="1" cellpadding="3" cellspacing="0" width="100%">
28 <tr align="center" bgcolor="#ccccff">
36 <td>external-general-entities</td>
37 <td><em>read/write</em></td>
38 <td><em>unspecified</em></td>
39 <td> Reports whether this parser processes external
40 general entities; always true if validating.
45 <td>external-parameter-entities</td>
46 <td><em>read/write</em></td>
47 <td><em>unspecified</em></td>
48 <td> Reports whether this parser processes external
49 parameter entities; always true if validating.
54 <td>is-standalone</td>
55 <td>(parsing) <em>read-only</em>, (not parsing) <em>none</em></td>
56 <td>not applicable</td>
57 <td> May be examined only during a parse, after the
58 <em>startDocument()</em> callback has been completed; read-only.
59 The value is true if the document specified standalone="yes" in
60 its XML declaration, and otherwise is false.
65 <td>lexical-handler/parameter-entities</td>
66 <td><em>read/write</em></td>
67 <td><em>unspecified</em></td>
68 <td> A value of "true" indicates that the LexicalHandler will report
69 the beginning and end of parameter entities.
75 <td><em>read/write</em></td>
77 <td> A value of "true" indicates namespace URIs and unprefixed local names
78 for element and attribute names will be available.
83 <td>namespace-prefixes</td>
84 <td><em>read/write</em></td>
86 <td> A value of "true" indicates that XML qualified names (with prefixes) and
87 attributes (including <em>xmlns*</em> attributes) will be available.
92 <td>resolve-dtd-uris</td>
93 <td><em>read/write</em></td>
94 <td><em>true</em></td>
95 <td> A value of "true" indicates that system IDs in declarations will
96 be absolutized (relative to their base URIs) before reporting.
97 (That is the default behavior for all SAX2 XML parsers.)
98 A value of "false" indicates those IDs will not be absolutized;
99 parsers will provide the base URI from
100 <em>Locator.getSystemId()</em>.
101 This applies to system IDs passed in <ul>
102 <li><em>DTDHandler.notationDecl()</em>,
103 <li><em>DTDHandler.unparsedEntityDecl()</em>, and
104 <li><em>DeclHandler.externalEntityDecl()</em>.
106 It does not apply to <em>EntityResolver.resolveEntity()</em>,
107 which is not used to report declarations, or to
108 <em>LexicalHandler.startDTD()</em>, which already provides
109 the non-absolutized URI.
114 <td>string-interning</td>
115 <td><em>read/write</em></td>
116 <td><em>unspecified</em></td>
117 <td> Has a value of "true" if all XML names (for elements, prefixes,
118 attributes, entities, notations, and local names),
119 as well as Namespace URIs, will have been interned
120 using <em>java.lang.String.intern</em>. This supports fast
121 testing of equality/inequality against string constants,
122 rather than forcing slower calls to <em>String.equals()</em>.
127 <td>unicode-normalization-checking</td>
128 <td><em>read/write</em></td>
129 <td><em>false</em></td>
130 <td> Controls whether the parser reports Unicode normalization
131 errors as described in section 2.13 and Appendix B of the
132 XML 1.1 Recommendation. If true, Unicode normalization
133 errors are reported using the ErrorHandler.error() callback.
134 Such errors are not fatal in themselves (though, obviously,
135 other Unicode-related encoding errors may be).
140 <td>use-attributes2</td>
141 <td><em>read-only</em></td>
142 <td>not applicable</td>
143 <td> Returns "true" if the <em>Attributes</em> objects passed by
144 this parser in <em>ContentHandler.startElement()</em>
145 implement the <a href="ext/Attributes2.html"
146 ><em>org.xml.sax.ext.Attributes2</em></a> interface.
147 That interface exposes additional DTD-related information,
148 such as whether the attribute was specified in the
149 source text rather than defaulted.
154 <td>use-locator2</td>
155 <td><em>read-only</em></td>
156 <td>not applicable</td>
157 <td> Returns "true" if the <em>Locator</em> objects passed by
158 this parser in <em>ContentHandler.setDocumentLocator()</em>
159 implement the <a href="ext/Locator2.html"
160 ><em>org.xml.sax.ext.Locator2</em></a> interface.
161 That interface exposes additional entity information,
162 such as the character encoding and XML version used.
167 <td>use-entity-resolver2</td>
168 <td><em>read/write</em></td>
169 <td><em>true</em></td>
170 <td> Returns "true" if, when <em>setEntityResolver</em> is given
171 an object implementing the <a href="ext/EntityResolver2.html"
172 ><em>org.xml.sax.ext.EntityResolver2</em></a> interface,
173 those new methods will be used.
174 Returns "false" to indicate that those methods will not be used.
180 <td><em>read/write</em></td>
181 <td><em>unspecified</em></td>
182 <td> Controls whether the parser is reporting all validity
183 errors; if true, all external entities will be read.
189 <td><em>read/write</em></td>
190 <td><em>false</em></td>
191 <td> Controls whether, when the <em>namespace-prefixes</em> feature
192 is set, the parser treats namespace declaration attributes as
193 being in the <em>http://www.w3.org/2000/xmlns/</em> namespace.
194 By default, SAX2 conforms to the original "Namespaces in XML"
195 Recommendation, which explicitly states that such attributes are
196 not in any namespace.
197 Setting this optional flag to "true" makes the SAX2 events conform to
198 a later backwards-incompatible revision of that recommendation,
199 placing those attributes in a namespace.
205 <td><em>read-only</em></td>
206 <td>not applicable</td>
207 <td> Returns "true" if the parser supports both XML 1.1 and XML 1.0.
208 Returns "false" if the parser supports only XML 1.0.
214 <p> Support for the default values of the
215 <em>namespaces</em> and <em>namespace-prefixes</em>
216 properties is required.
217 Support for any other feature flags is entirely optional.
220 <p> For default values not specified by SAX2,
221 each XMLReader implementation specifies its default,
222 or may choose not to expose the feature flag.
223 Unless otherwise specified here,
224 implementations may support changing current values
225 of these standard feature flags, but not while parsing.
228 <h2> SAX2 Standard Handler and Property IDs </h2>
230 <p> For parser interface characteristics that are described
231 as objects, a separate namespace is defined. The
232 objects in this namespace are again identified by URI, and
233 the standard property URIs have the prefix
234 <code>http://xml.org/sax/properties/</code> before an identifier such as
235 <code>lexical-handler</code> or
236 <code>dom-node</code>. Manage those properties using
237 <em>setProperty()</em>. Those identifiers are: </p>
239 <table border="1" cellpadding="3" cellspacing="0" width="100%">
240 <tr align="center" bgcolor="#ccccff">
246 <td>declaration-handler</td>
247 <td> Used to see most DTD declarations except those treated
248 as lexical ("document element name is ...") or which are
249 mandatory for all SAX parsers (<em>DTDHandler</em>).
250 The Object must implement <a href="ext/DeclHandler.html"
251 ><em>org.xml.sax.ext.DeclHandler</em></a>.
256 <td>document-xml-version</td>
257 <td> May be examined only during a parse, after the startDocument()
258 callback has been completed; read-only. This property is a
259 literal string describing the actual XML version of the document,
260 such as "1.0" or "1.1".
266 <td> For "DOM Walker" style parsers, which ignore their
267 <em>parser.parse()</em> parameters, this is used to
268 specify the DOM (sub)tree being walked by the parser.
269 The Object must implement the
270 <em>org.w3c.dom.Node</em> interface.
275 <td>lexical-handler</td>
276 <td> Used to see some syntax events that are essential in some
277 applications: comments, CDATA delimiters, selected general
278 entity inclusions, and the start and end of the DTD
279 (and declaration of document element name).
280 The Object must implement <a href="ext/LexicalHandler.html"
281 ><em>org.xml.sax.ext.LexicalHandler</em></a>.
287 <td> Readable only during a parser callback, this exposes a <b>TBS</b>
288 chunk of characters responsible for the current event. </td>
293 <p> All of these standard properties are optional;
294 XMLReader implementations need not support them.