| <?xml version="1.0" standalone="no"?> |
| <!DOCTYPE s1 SYSTEM "./dtd/document.dtd"> |
| |
| <s1 title="Features"> |
| <s2 title="Setting Features"> |
| <anchor name="features"/> |
| <p>To set a feature on either org.apache.xerces.parsers.SAXParser or |
| org.apache.xerces.parsers.DOMParser, you should use the SAX2 |
| method <code>setFeature(String,boolean)</code>. To query a |
| feature, use the SAX2 method <code>getFeature(String)</code>.</p> |
| <p>For example, to turn on validation:</p> |
| <source>SAXParser p=new SAXParser(); |
| try { |
| p.setFeature("http://xml.org/sax/features/validation", true); |
| } catch (SAXException e) { |
| System.out.println("error in setting up parser feature"); |
| }</source> |
| </s2> |
| |
| <s2 title="General Features"> |
| <anchor name="validation"/> |
| <p>http://xml.org/sax/features/validation</p> |
| <table> |
| <tr><th>True:</th> <td>Validate the document.</td></tr> |
| <tr><th>False:</th> <td>Do not validate the document.</td></tr> |
| <tr><th>Default:</th> <td>false</td></tr> |
| <tr><th>Access:</th> <td>(parsing) read-only; (not parsing) read/write</td></tr> |
| <tr><th>Note:</th> <td>If this feature is set to true, the document must specify a grammar. |
| If this feature is set to false, the document may specify a grammar |
| and that grammar will be parsed but no validation of the document |
| contents will be performed.</td></tr> |
| <tr><th>See:</th> <td><link anchor="dynamic">http://apache.org/xml/features/validation/dynamic</link> |
| <br/><link anchor="namespaces">http://xml.org/sax/features/namespaces</link></td></tr> |
| </table> |
| |
| <anchor name="external-general-entities"/> |
| <p>http://xml.org/sax/features/external-general-entities</p> |
| <table> |
| <tr><th>True:</th> <td>Include external general (text) entities.</td></tr> |
| <tr><th>False:</th> <td>Do not include external general entities.</td></tr> |
| <tr><th>Default:</th> <td>true</td></tr> |
| <tr><th>Access:</th> <td>(parsing) read-only; (not parsing) read/write</td></tr> |
| <tr><th>See:</th> |
| <td><link anchor="external-parameter-entities">http://xml.org/sax/features/external-parameter-entities</link></td></tr> |
| </table> |
| |
| <anchor name="external-parameter-entities"/> |
| <p>http://xml.org/sax/features/external-parameter-entities</p> |
| <table> |
| <tr><th>True:</th> <td>Include external parameter entities and the external DTD subset.</td></tr> |
| <tr><th>False:</th> <td>Do not include external parameter entities or the external DTD subset.</td></tr> |
| <tr><th>Default:</th> <td>true</td></tr> |
| <tr><th>Access:</th> <td>(parsing) read-only; (not parsing) read/write</td></tr> |
| <tr><th>See:</th> |
| <td><link anchor="external-parameter-entities">http://xml.org/sax/features/external-parameter-entities</link></td></tr> |
| </table> |
| |
| <anchor name="namespaces"/> |
| <p>http://xml.org/sax/features/namespaces</p> |
| <table> |
| <tr><th>True:</th> <td>Perform namespace processing: prefixes will be stripped off element and |
| attribute names and replaced with the corresponding namespace URIs. By |
| default, the two will simply be concatenated, but the namespace-sep core |
| property allows the application to specify a delimiter string for |
| separating the URI part and the local part.</td></tr> |
| <tr><th>False:</th> <td>Do not perform namespace processing.</td></tr> |
| <tr><th>Default:</th> <td>false</td></tr> |
| <tr><th>Access:</th> <td>(parsing) read-only; (not parsing) read/write</td></tr> |
| <tr><th>Note:</th> <td>If the validation feature is set to true, then the document must contain |
| a grammar that supports the use of namespaces.</td></tr> |
| <tr><th>See:</th> <td><link anchor="validation">http://xml.org/sax/features/validation</link> |
| <br/><link idref="properties" anchor="namespace-sep">http://xml.org/sax/properties/namespace-sep</link></td></tr> |
| </table> |
| |
| <anchor name="schema"/> |
| <p>http://apache.org/xml/features/validation/schema</p> |
| <table> |
| <tr><th>True:</th> <td>Turn on XML Schema support.</td></tr> |
| <tr><th>False:</th> <td>Turn off XML Schema support.</td></tr> |
| <tr><th>Default:</th> <td>true</td></tr> |
| </table> |
| |
| <anchor name="dynamic"/> |
| <p>http://apache.org/xml/features/validation/dynamic</p> |
| <table> |
| <tr><th>True:</th> <td>The parser will validate the document only if a grammar is specified.</td></tr> |
| <tr><th>False:</th> <td>Validation is determined by the state of the |
| <link anchor="validation">http://xml.org/sax/features/validation</link> feature.</td></tr> |
| <tr><th>Default:</th> <td>false</td></tr> |
| <tr><th>See:</th> <td><link anchor="validation">http://xml.org/sax/features/validation</link></td></tr> |
| </table> |
| |
| <anchor name="warn-on-duplicate-attdef"/> |
| <p>http://apache.org/xml/features/validation/warn-on-duplicate-attdef</p> |
| <table> |
| <tr><th>True:</th><td>Warn on duplicate attribute declaration.</td></tr> |
| <tr><th>False:</th><td>Do not warn on duplicate attribute declaration.</td></tr> |
| <tr><th>Default:</th><td>true</td></tr> |
| </table> |
| |
| <anchor name="warn-on-undeclared-elemdef"/> |
| <p>http://apache.org/xml/features/validation/warn-on-undeclared-elemdef</p> |
| <table> |
| <tr><th>True:</th> <td>Warn if element referenced in content model is not declared.</td></tr> |
| <tr><th>False:</th> <td>Do not warn if element referenced in content model is not declared.</td></tr> |
| <tr><th>Default:</th> <td>true</td></tr> |
| </table> |
| |
| <anchor name="allow-java-encodings"/> |
| <p>http://apache.org/xml/features/allow-java-encodings</p> |
| <table> |
| <tr><th>True:</th> <td>Allow Java encoding names in XMLDecl and TextDecl line.</td></tr> |
| <tr><th>False:</th> <td>Do not allow Java encoding names in XMLDecl and TextDecl line.</td></tr> |
| <tr><th>Default:</th> <td>false</td></tr> |
| <tr><th>Note:</th> <td>A true value for this feature allows the encoding of the file to be |
| specified as a Java encoding name as well as the standard ISO encoding |
| name. Be aware that other parsers may not be able to use Java encoding |
| names. If this feature is set to false, an error will be generated if |
| Java encoding names are used.</td></tr> |
| </table> |
| |
| <anchor name="continue-after-fatal-error"/> |
| <p>http://apache.org/xml/features/continue-after-fatal-error</p> |
| <table> |
| <tr><th>True:</th><td>Continue after fatal error.</td></tr> |
| <tr><th>False:</th><td>Stops parse on first fatal error.</td></tr> |
| <tr><th>Default:</th><td>false</td></tr> |
| </table> |
| |
| <anchor name="load-dtd-grammar"/> |
| <p>http://apache.org/xml/features/nonvalidating/load-dtd-grammar</p> |
| <table> |
| <tr><th>True:</th><td> Will load the DTD Grammar, based on the information provided in DTD, |
| add default attribute information and set the attribute type when parsing.</td></tr> |
| <tr><th>False:</th><td>Will ignore the DTD grammar.</td></tr> |
| <tr><th>Default:</th><td>true</td></tr> |
| <tr><th>Note:</th> <td>This feature functions only when the validation is turned off.</td></tr> |
| </table> |
| </s2> |
| <s2 title="DOM Features"> |
| <anchor name="defer-node-expansion"/> |
| <p>http://apache.org/xml/features/dom/defer-node-expansion</p> |
| <table> |
| <tr><th>True:</th> <td>Lazy DOM node expansion.</td></tr> |
| <tr><th>False:</th> <td>Full DOM node expansion.</td></tr> |
| <tr><th>Default:</th> <td>true</td></tr> |
| <tr><th>Note:</th> <td>This feature only applies when the |
| <link idref="properties" anchor="document-class-name">http://apache.org/xml/properties/dom/document-class-name</link> property is |
| set to a value other than the name of the default document factory. |
| If this feature is set to true, the DOM nodes in the returned |
| document are expanded as the tree is traversed. This feature allows |
| the parser to return a document faster than if the tree is fully |
| expanded during parsing and improves memory usage when the whole |
| tree is not traversed.</td></tr> |
| <tr><th>See</th> <td><link idref="properties" anchor="document-class-name">http://apache.org/xml/properties/dom/document-class-name</link></td></tr> |
| </table> |
| |
| <anchor name="create-entity-ref-nodes"/> |
| <p>http://apache.org/xml/features/dom/create-entity-ref-nodes</p> |
| <table> |
| <tr><th>True:</th> <td>Create EntityReference nodes in the DOM tree. The EntityReference nodes and their child nodes will be read-only.</td></tr> |
| <tr><th>False:</th> <td>Do not create EntityReference nodes in the DOM tree. No EntityReference nodes will be created, only the nodes corresponding to their fully expanded sustitution text will be created.</td></tr> |
| <tr><th>Default:</th> <td>true</td></tr> |
| <tr><th>Note:</th> <td>This feature only affects the appearance of EntityReference nodes in |
| the DOM tree. The document will always contain the entity reference |
| child nodes.</td></tr> |
| </table> |
| |
| <anchor name="include-ignorable-whitespace"/> |
| <p>http://apache.org/xml/features/dom/include-ignorable-whitespace</p> |
| <table> |
| <tr><th>True:</th> <td>Includes text nodes that can be |
| considered "ignorable whitespace" in the DOM tree.</td></tr> |
| <tr><th>False:</th> <td>Does not include ignorable whitespace in the DOM tree.</td></tr> |
| <tr><th>Default:</th> <td>true</td></tr> |
| <tr><th>Note:</th> <td>The only way that the parser can determine if text is ignorable is |
| by reading the associated grammar and having a content model for |
| the document. When ignorable whitespace text nodes are included in |
| the DOM tree, they will be flagged as ignorable. The ignorable flag |
| can be queried by calling the TextImpl#isIgnorableWhitespace():boolean |
| method.</td></tr> |
| </table> |
| |
| <anchor name="grammar-access"/> |
| <p>http://apache.org/xml/features/domx/grammar-access</p> |
| <table> |
| <tr><th>True:</th> <td>Creates nodes that describe the grammar in the DOM tree.</td></tr> |
| <tr><th>False:</th> <td>Does not create create grammar access nodes in the DOM |
| tree. This setting makes the DOM behave as a standard |
| DOM Level 1 implementation.</td></tr> |
| <tr><th>Default:</th> <td>false</td></tr> |
| <tr><th>Note:</th> <td>The grammar access nodes are appended as children of the |
| DocumentType node. The grammar is specified as an |
| XML Schema document tree, whether it was read from a |
| document with an associated DTD or XML Schema grammar. |
| This is currently a violation of the DOM Level 1 |
| specification. |
| <br/><em>**** This is an experimental feature that is not guaranteed </em> |
| <br/><em>**** to be supported in future versions of |
| the parser.</em></td></tr> |
| </table> |
| </s2> |
| <s2 title="SAX Features"> |
| <!-- |
| <anchor name="use-locator"/> |
| <p>http://xml.org/sax/features/use-locator</p> |
| <table> |
| <tr><th>True:</th> <td>Provide a Locator using the DocumentHandler setDocumentLocator callback.</td></tr> |
| <tr><th>False:</th> <td>Explicitly allow the parser not to provide a Locator (but it still may).</td></tr> |
| <tr><th>Default:</th> <td>true</td></tr> |
| <tr><th>Note:</th> <td>Xerces-J always provides a Locator to the document handler</td></tr> |
| </table> |
| |
| <anchor name="normalize-text"/> |
| <p>http://xml.org/sax/features/normalize-text</p> |
| <table> |
| <tr><th>True:</th> <td>Ensure that all consecutive text is returned |
| in a single callback to the DocumentHandler |
| characters method.</td></tr> |
| <tr><th>False:</th> <td>Explicitly allow the parser to split |
| consecutive text into more than one callback |
| (but it still may not do so).</td></tr> |
| <tr><th>Default:</th> <td>true</td></tr> |
| <tr><th>Note:</th> <td>Xerces-J currently does not support allowing |
| consecutive text to be buffered and returned |
| in a single callback to the DocumentHandler |
| characters method.</td></tr> |
| </table> |
| --> |
| <anchor name='namespace-prefixes'/> |
| <p>http://xml.org/sax/features/namespace-prefixes</p> |
| <table> |
| <tr><th>True:</th> <td>Report the original prefixed names and attributes used for Namespace declarations.</td></tr> |
| <tr><th>False:</th> <td>Do not report attributes used for Namespace declarations, and optionally do not report original prefixed names.</td></tr> |
| <tr><th>Default:</th> <td>true</td></tr> |
| <tr><th>Access:</th> <td>(parsing) read-only; (not parsing) read/write</td></tr> |
| </table> |
| <anchor name='string-interning'/> |
| <p>http://xml.org/sax/features/string-interning</p> |
| <table> |
| <tr><th>True:</th> <td>All element names, prefixes, attribute names, Namespace URIs, and local names are internalized using java.lang.String.intern.</td></tr> |
| <tr><th>False:</th> <td>Names are not necessarily internalized.</td></tr> |
| <tr><th>Default:</th> <td>false</td></tr> |
| <tr><th>Access:</th> <td>(parsing) read-only; (not parsing) read/write</td></tr> |
| <tr><th>Note:</th> <td>Xerces-J does not support interning all strings using the |
| String.intern() method because Xerces-J does its own intern |
| optimizations for String objects.</td></tr> |
| </table> |
| </s2> |
| </s1> |
| |