You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2042 lines
107 KiB

  1. <?xml version="1.0" standalone="no"?>
  2. <!--
  3. * Licensed to the Apache Software Foundation (ASF) under one or more
  4. * contributor license agreements. See the NOTICE file distributed with
  5. * this work for additional information regarding copyright ownership.
  6. * The ASF licenses this file to You under the Apache License, Version 2.0
  7. * (the "License"); you may not use this file except in compliance with
  8. * the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. -->
  18. <!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">
  19. <s1 title="DOM Programming Guide">
  20. <anchor name="Objectives"/>
  21. <s2 title="Design Objectives">
  22. <p>The C++ DOM implementation is based on the
  23. <jump href="ApacheDOMC++Binding.html">Apache Recommended DOM C++ binding</jump>.</p>
  24. <p>The design objective aims at meeting the following requirements:
  25. </p>
  26. <ul>
  27. <li>Reduced memory footprint.</li>
  28. <li>Fast - especially for use in server style and multi-threaded applications.</li>
  29. <li>Good scalability on multiprocessor systems.</li>
  30. <li>More C++ like and less Java like.</li>
  31. </ul>
  32. </s2>
  33. <anchor name="DOM3"/>
  34. <s2 title="DOM Level 3 Support in &XercesCName;">
  35. <p>The &XercesCName; &XercesC3Version; contains an implementation of the W3C DOM Level 3 as specified in </p>
  36. <ul>
  37. <li><jump href="http://www.w3.org/TR/DOM-Level-3-Core/">
  38. DOM Level 3.0 Core Specification</jump>, Version 1.0 W3C Recommendation 07 April 2004 and</li>
  39. <li> <jump href="http://www.w3.org/TR/DOM-Level-3-LS/">
  40. Document Object Model (DOM) Level 3 Load and Save Specification</jump>,
  41. Version 1.0 W3C Recommendation 07 April 2004</li>
  42. </ul>
  43. <s3 title='Implementation of DOM Level 3 Core'>
  44. <p>The following are NOT implemented in &XercesCName; &XercesC3Version;.</p>
  45. <ul>
  46. <li>
  47. <code>DOMError</code>: setRelatedException
  48. </li>
  49. <li>
  50. <code>DOMImplementation</code>: createLSParser(MODE_ASYNCHRONOUS)
  51. </li>
  52. <li>
  53. <code>DOMTypeInfo</code>: isDerivedFrom()
  54. </li>
  55. </ul>
  56. </s3>
  57. </s2>
  58. <anchor name="UsingDOMAPI"/>
  59. <s2 title="Using DOM API">
  60. <anchor name="AccessAPI"/>
  61. <s3 title="Accessing API from application code">
  62. <source>
  63. #include &lt;xercesc/dom/DOM.hpp></source>
  64. <p>The header file &lt;dom/DOM.hpp&gt; includes all the
  65. individual headers for the DOM API classes. </p>
  66. </s3>
  67. <anchor name="DOMClassNames"/>
  68. <s3 title="Class Names">
  69. <p>
  70. The DOM class names are prefixed with "DOM" (if not already), e.g. "DOMNode". The intent is
  71. to prevent conflicts between DOM class names and other names
  72. that may already be in use by an application or other
  73. libraries that a DOM based application must link with.</p>
  74. <source>
  75. DOMDocument* myDocument;
  76. DOMNode* aNode;
  77. DOMText* someText;
  78. </source>
  79. </s3>
  80. <anchor name="DOMObjMgmt"/>
  81. <s3 title="Objects Management">
  82. <p>Applications would use normal C++ pointers to directly access the
  83. implementation objects for Nodes in C++ DOM.
  84. </p>
  85. <p>Consider the following code snippets</p>
  86. <source>
  87. DOMNode* aNode;
  88. DOMNode* docRootNode;
  89. aNode = someDocument->createElement(anElementName);
  90. docRootNode = someDocument->getDocumentElement();
  91. docRootNode->appendChild(aNode);
  92. </source>
  93. </s3>
  94. <anchor name="DOMMemMgmt"/>
  95. <s3 title="Memory Management">
  96. <p>The C++ DOM implementation provides a release() method for releasing any "orphaned"
  97. resources that were created through createXXXX factory method.
  98. Memory for any returned object are owned by implementation. Please see
  99. <jump href="ApacheDOMC++Binding.html#release"> Apache Recommended DOM C++ binding</jump>
  100. for details.</p>
  101. <s4 title="Objects created by DOMImplementation::createXXXX">
  102. <p>Users <em>must</em> call the release() function when finished using any objects that
  103. were created by the DOMImplementation::createXXXX (e.g. DOMLSParser, DOMLSSerializer, DOMLSInput, DOMLSOutput, DOMDocument,
  104. DOMDocumentType).</p>
  105. <p>Access to a released object will lead to unexpected behaviour.</p>
  106. <note>When a DOMDocument is released, all its associated children AND any objects it owned
  107. (e.g. DOMRange, DOMTreeWalker, DOMNodeIterator or any orphaned nodes) will also be released.
  108. </note>
  109. <note>When a DOMDocument is cloned, the cloned document has nothing related to the original
  110. master document and need to be released explicitly.
  111. </note>
  112. <note>When a DOMDocumentType has been inserted into a DOMDocument and thus has a owner,
  113. it will then be released automatically when its owner document is released.
  114. DOMException::INVALID_ACCESS_ERR will be raised if releasing such owned node.
  115. </note>
  116. </s4>
  117. <s4 title="Objects created by DOMDocument::createXXXX">
  118. <p>Users <em>can</em> call the release() function to indicate the release of any orphaned nodes.
  119. When an orphaned Node is released, its associated children will also be released.
  120. Access to a released Node will lead to unexpected behaviour. These orphaned Nodes will
  121. eventually be released, if not already done so, when its owner document is released</p>
  122. <note>DOMException::INVALID_ACCESS_ERR will be raised if releasing a Node that has a parent
  123. (has a owner).</note>
  124. </s4>
  125. <s4 title="Objects created by DOMDocumentRange::createRange or DOMDocumentTraversal::createXXXX">
  126. <p>Users <em>can</em> call release() function when finished using the DOMRange,
  127. DOMNodeIterator, DOMTreeWalker.
  128. Access to a released object will lead to unexpected behaviour. These objects will
  129. eventually be released, if not already done so, when its owner document is released
  130. </p>
  131. </s4>
  132. <p>Here is an example</p>
  133. <source>
  134. //
  135. // Create a small document tree
  136. //
  137. {
  138. XMLCh tempStr[100];
  139. XMLString::transcode("Range", tempStr, 99);
  140. DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(tempStr, 0);
  141. XMLString::transcode("root", tempStr, 99);
  142. DOMDocument* doc = impl->createDocument(0, tempStr, 0);
  143. DOMElement* root = doc->getDocumentElement();
  144. XMLString::transcode("FirstElement", tempStr, 99);
  145. DOMElement* e1 = doc->createElement(tempStr);
  146. root->appendChild(e1);
  147. XMLString::transcode("SecondElement", tempStr, 99);
  148. DOMElement* e2 = doc->createElement(tempStr);
  149. root->appendChild(e2);
  150. XMLString::transcode("aTextNode", tempStr, 99);
  151. DOMText* textNode = doc->createTextNode(tempStr);
  152. e1->appendChild(textNode);
  153. // optionally, call release() to release the resource associated with the range after done
  154. DOMRange* range = doc->createRange();
  155. range->release();
  156. // removedElement is an orphaned node, optionally call release() to release associated resource
  157. DOMElement* removedElement = root->removeChild(e2);
  158. removedElement->release();
  159. // no need to release this returned object which is owned by implementation
  160. XMLString::transcode("*", tempStr, 99);
  161. DOMNodeList* nodeList = doc->getElementsByTagName(tempStr);
  162. // done with the document, must call release() to release the entire document resources
  163. doc->release();
  164. };
  165. </source>
  166. </s3>
  167. <anchor name="XMLCh"/>
  168. <s3 title="String Type">
  169. <p>The C++ DOM uses the plain, null-terminated (XMLCh *) utf-16 strings
  170. as the String type. The (XMLCh*) utf-16 type string has low overhead.</p>
  171. <source>
  172. //C++ DOM
  173. const XMLCh* nodeValue = aNode->getNodeValue();
  174. </source>
  175. <p>All the string data would remain in memory until the document object is released.
  176. But such string data may be RECYCLED by the implementation if necessary.
  177. Users should make appropriate copy of any returned string for safe reference.</p>
  178. <p>For example after a DOMNode has been released, the memory allocated for its node value
  179. will be recycled by the implementation. </p>
  180. <source>
  181. XMLCh xfoo[] = {chLatin_f, chLatin_o, chLatin_o, chNull};
  182. // pAttr has node value = "foo"
  183. // fNodeValue has "foo"
  184. pAttr->setNodeValue(xfoo);
  185. const XMLCh* fNodeValue = pAttr->getNodeValue();
  186. // fNodeValue has "foo"
  187. // make a copy of the string for future reference
  188. XMLCh* oldNodeValue = XMLString::replicate(fNodeValue);
  189. // release the node pAttr
  190. pAttr->release()
  191. // other operations
  192. :
  193. :
  194. // implementation may have recycled the memory of the pAttr already
  195. // so it's not safe to expect fNodeValue still have "foo"
  196. if (XMLString::compareString(xfoo, fNodeValue))
  197. printf("fNodeValue has some other content\n");
  198. // should use your own safe copy
  199. if (!XMLString::compareString(xfoo, oldNodeValue))
  200. printf("Use your own copy of the oldNodeValue if want to reference the string later\n");
  201. // delete your own replicated string when done
  202. XMLString::release(&amp;oldNodeValue);
  203. </source>
  204. <p>Or if DOMNode::setNodeValue() is called to set a new node value,
  205. the implementation will simply overwrite the node value memory area. So any previous
  206. pointers will now have the new value automatically. Users should make appropriate
  207. copy of any previous returned string for safe reference. For example</p>
  208. <source>
  209. XMLCh xfoo[] = {chLatin_f, chLatin_o, chLatin_o, chNull};
  210. XMLCh xfee[] = {chLatin_f, chLatin_e, chLatin_e, chNull};
  211. // pAttr has node value = "foo"
  212. pAttr->setNodeValue(xfoo);
  213. const XMLCh* fNodeValue = pAttr->getNodeValue();
  214. // fNodeValue has "foo"
  215. // make a copy of the string for future reference
  216. XMLCh* oldNodeValue = XMLString::replicate(fNodeValue);
  217. // now set pAttr with a new node value "fee"
  218. pAttr->setNodeValue(xfee);
  219. // should not rely on fNodeValue for the old node value, it may not compare
  220. if (XMLString::compareString(xfoo, fNodeValue))
  221. printf("Should not rely on fNodeValue for the old node value\n");
  222. // should use your own safe copy
  223. if (!XMLString::compareString(xfoo, oldNodeValue))
  224. printf("Use your own copy of the oldNodeValue if want to reference the string later\n");
  225. // delete your own replicated string when done
  226. XMLString::release(&amp;oldNodeValue);
  227. </source>
  228. <p>This is to prevent memory growth when DOMNode::setNodeValue() is being called hundreds of
  229. times. This design allows users to actively select which returned string should stay
  230. in memory by manually copying the string to application's own heap.</p>
  231. </s3>
  232. </s2>
  233. <anchor name="XercesDOMParser"/>
  234. <s2 title="XercesDOMParser">
  235. <anchor name="ConstructXercesDOMParser"/>
  236. <s3 title="Constructing a XercesDOMParser">
  237. <p>In order to use &XercesCName; to parse XML files using DOM, you
  238. can create an instance of the XercesDOMParser class. The example
  239. below shows the code you need in order to create an instance of the
  240. XercesDOMParser.</p>
  241. <source>
  242. #include &lt;xercesc/parsers/XercesDOMParser.hpp>
  243. #include &lt;xercesc/dom/DOM.hpp>
  244. #include &lt;xercesc/sax/HandlerBase.hpp>
  245. #include &lt;xercesc/util/XMLString.hpp>
  246. #include &lt;xercesc/util/PlatformUtils.hpp>
  247. #include &lt;iostream>
  248. using namespace std;
  249. using namespace xercesc;
  250. int main (int argc, char* args[]) {
  251. try {
  252. XMLPlatformUtils::Initialize();
  253. }
  254. catch (const XMLException&amp; toCatch) {
  255. char* message = XMLString::transcode(toCatch.getMessage());
  256. cout &lt;&lt; "Error during initialization! :\n"
  257. &lt;&lt; message &lt;&lt; "\n";
  258. XMLString::release(&amp;message);
  259. return 1;
  260. }
  261. XercesDOMParser* parser = new XercesDOMParser();
  262. parser->setValidationScheme(XercesDOMParser::Val_Always);
  263. parser->setDoNamespaces(true); // optional
  264. ErrorHandler* errHandler = (ErrorHandler*) new HandlerBase();
  265. parser->setErrorHandler(errHandler);
  266. char* xmlFile = "x1.xml";
  267. try {
  268. parser->parse(xmlFile);
  269. }
  270. catch (const XMLException&amp; toCatch) {
  271. char* message = XMLString::transcode(toCatch.getMessage());
  272. cout &lt;&lt; "Exception message is: \n"
  273. &lt;&lt; message &lt;&lt; "\n";
  274. XMLString::release(&amp;message);
  275. return -1;
  276. }
  277. catch (const DOMException&amp; toCatch) {
  278. char* message = XMLString::transcode(toCatch.msg);
  279. cout &lt;&lt; "Exception message is: \n"
  280. &lt;&lt; message &lt;&lt; "\n";
  281. XMLString::release(&amp;message);
  282. return -1;
  283. }
  284. catch (...) {
  285. cout &lt;&lt; "Unexpected Exception \n" ;
  286. return -1;
  287. }
  288. delete parser;
  289. delete errHandler;
  290. return 0;
  291. }
  292. </source>
  293. </s3>
  294. <anchor name="XercesDOMFeatures"/>
  295. <s3 title="XercesDOMParser Supported Features">
  296. <p>The behavior of the XercesDOMParser is dependent on the values of the following features. All
  297. of the features below are set using the "setter" methods (e.g. <code>setDoNamespaces</code>),
  298. and are queried using the corresponding "getter" methods (e.g. <code>getDoNamespaces</code>).
  299. The following only gives you a quick summary of supported features. Please
  300. refer to <jump href="api-&XercesC3Series;.html">API Documentation</jump> for complete detail.
  301. </p>
  302. <anchor name="createEntityRef"/>
  303. <table>
  304. <tr><th colspan="2"><em>void setCreateEntityReferenceNodes(const bool)</em></th></tr>
  305. <tr><th><em>true:</em></th><td> Create EntityReference nodes in the DOM tree. The
  306. EntityReference nodes and their child nodes will be read-only. </td></tr>
  307. <tr><th><em>false:</em></th><td> Do not create EntityReference nodes in the DOM tree. No
  308. EntityReference nodes will be created, only the nodes corresponding to their fully
  309. expanded substitution text will be created. </td></tr>
  310. <tr><th><em>default:</em></th><td> true </td></tr>
  311. <tr><th><em>note:</em></th><td> This feature only affects the appearance of
  312. EntityReference nodes in the DOM tree. The document will always contain the entity
  313. reference child nodes. </td></tr>
  314. </table>
  315. <p/>
  316. <table>
  317. <tr><th colspan="2"><em>void setIncludeIgnorableWhitespace(const bool)</em></th></tr>
  318. <tr><th><em>true:</em></th><td> Include text nodes that can be considered "ignorable
  319. whitespace" in the DOM tree. </td></tr>
  320. <tr><th><em>false:</em></th><td> Do not include ignorable whitespace in the DOM tree. </td></tr>
  321. <tr><th><em>default:</em></th><td> true </td></tr>
  322. <tr><th><em>note:</em></th><td> The only way that the parser can determine if text is
  323. ignorable is by reading the associated grammar and having a content model for the
  324. document. When ignorable whitespace text nodes are included in the DOM tree,
  325. they will be flagged as ignorable; and the method DOMText::isIgnorableWhitespace()
  326. will return true for those text nodes. </td></tr>
  327. </table>
  328. <p/>
  329. <anchor name="namespaces"/>
  330. <table>
  331. <tr><th colspan="2"><em>void setDoNamespaces(const bool)</em></th></tr>
  332. <tr><th><em>true:</em></th><td> Perform Namespace processing. </td></tr>
  333. <tr><th><em>false:</em></th><td> Do not perform Namespace processing. </td></tr>
  334. <tr><th><em>default:</em></th><td> false </td></tr>
  335. <tr><th><em>note:</em></th><td> If the validation scheme is set to Val_Always or Val_Auto, then the
  336. document must contain a grammar that supports the use of namespaces. </td></tr>
  337. <tr><th><em>see:</em></th><td>
  338. <link anchor="validation-dynamic">setValidationScheme</link>
  339. </td></tr>
  340. </table>
  341. <p/>
  342. <anchor name="validation-dynamic"/>
  343. <table>
  344. <tr><th colspan="2"><em>void setValidationScheme(const ValSchemes)</em></th></tr>
  345. <tr><th><em>Val_Auto:</em></th><td> The parser will report validation errors only if a grammar is specified.</td></tr>
  346. <tr><th><em>Val_Always:</em></th><td> The parser will always report validation errors. </td></tr>
  347. <tr><th><em>Val_Never:</em></th><td> Do not report validation errors. </td></tr>
  348. <tr><th><em>default:</em></th><td> Val_Never </td></tr>
  349. <tr><th><em>note:</em></th><td> If set to Val_Always, the document must
  350. specify a grammar. If this feature is set to Val_Never and document specifies a grammar,
  351. that grammar might be parsed but no validation of the document contents will be
  352. performed. </td></tr>
  353. <tr><th><em>see:</em></th><td>
  354. <link anchor="load-external-dtd">setLoadExternalDTD</link>
  355. </td></tr>
  356. </table>
  357. <p/>
  358. <anchor name="schema"/>
  359. <table>
  360. <tr><th colspan="2"><em>void setDoSchema(const bool)</em></th></tr>
  361. <tr><th><em>true:</em></th><td> Enable the parser's schema support. </td></tr>
  362. <tr><th><em>false:</em></th><td> Disable the parser's schema support. </td></tr>
  363. <tr><th><em>default:</em></th><td> false </td></tr>
  364. <tr><th><em>note</em></th><td> If set to true, namespace processing must also be turned on. </td></tr>
  365. <tr><th><em>see:</em></th><td>
  366. <link anchor="namespaces">setDoNamespaces</link>
  367. </td></tr>
  368. </table>
  369. <p/>
  370. <table>
  371. <tr><th colspan="2"><em>void setValidationSchemaFullChecking(const bool)</em></th></tr>
  372. <tr><th><em>true:</em></th><td> Enable full schema constraint checking, including checking
  373. which may be time-consuming or memory intensive. Currently, particle unique
  374. attribution constraint checking and particle derivation restriction checking
  375. are controlled by this option. </td></tr>
  376. <tr><th><em>false:</em></th><td> Disable full schema constraint checking. </td></tr>
  377. <tr><th><em>default:</em></th><td> false </td></tr>
  378. <tr><th><em>note:</em></th><td> This feature checks the Schema grammar itself for
  379. additional errors that are time-consuming or memory intensive. It does <em>not</em> affect the
  380. level of checking performed on document instances that use Schema grammars.</td></tr>
  381. <tr><th><em>see:</em></th><td>
  382. <link anchor="schema">setDoSchema</link>
  383. </td></tr>
  384. </table>
  385. <p/>
  386. <anchor name="load-schema"/>
  387. <table>
  388. <tr><th colspan="2"><em>void setLoadSchema(const bool)</em></th></tr>
  389. <tr><th><em>true:</em></th><td> Load the schema. </td></tr>
  390. <tr><th><em>false:</em></th><td> Don't load the schema if it wasn't found in the grammar pool. </td></tr>
  391. <tr><th><em>default:</em></th><td> true </td></tr>
  392. <tr><th><em>note:</em></th><td> This feature is ignored and no schemas are loaded if schema processing is disabled. </td></tr>
  393. <tr><th><em>see:</em></th><td>
  394. <link anchor="schema">setDoSchema</link>
  395. </td></tr>
  396. </table>
  397. <p/>
  398. <anchor name="load-external-dtd"/>
  399. <table>
  400. <tr><th colspan="2"><em>void setLoadExternalDTD(const bool)</em></th></tr>
  401. <tr><th><em>true:</em></th><td> Load the External DTD . </td></tr>
  402. <tr><th><em>false:</em></th><td> Ignore the external DTD completely. </td></tr>
  403. <tr><th><em>default:</em></th><td> true </td></tr>
  404. <tr><th><em>note</em></th><td> This feature is ignored and DTD is always loaded
  405. if the validation scheme is set to Val_Always or Val_Auto. </td></tr>
  406. <tr><th><em>see:</em></th><td>
  407. <link anchor="validation-dynamic">setValidationScheme</link>
  408. </td></tr>
  409. </table>
  410. <p/>
  411. <anchor name="continue-after-fatal"/>
  412. <table>
  413. <tr><th colspan="2"><em>void setExitOnFirstFatalError(const bool)</em></th></tr>
  414. <tr><th><em>true:</em></th><td> Stops parse on first fatal error. </td></tr>
  415. <tr><th><em>false:</em></th><td> Attempt to continue parsing after a fatal error. </td></tr>
  416. <tr><th><em>default:</em></th><td> true </td></tr>
  417. <tr><th><em>note:</em></th><td> The behavior of the parser when this feature is set to
  418. false is <em>undetermined</em>! Therefore use this feature with extreme caution because
  419. the parser may get stuck in an infinite loop or worse.</td></tr>
  420. </table>
  421. <p/>
  422. <table>
  423. <tr><th colspan="2"><em>void setValidationConstraintFatal(const bool)</em></th></tr>
  424. <tr><th><em>true:</em></th><td> The parser will treat validation error as fatal and will
  425. exit depends on the state of
  426. <link anchor="continue-after-fatal">setExitOnFirstFatalError</link>
  427. </td></tr>
  428. <tr><th><em>false:</em></th><td> The parser will report the error and continue processing. </td></tr>
  429. <tr><th><em>default:</em></th><td> false </td></tr>
  430. <tr><th><em>note:</em></th><td> Setting this true does not mean the validation error will
  431. be printed with the word "Fatal Error". It is still printed as "Error", but the parser
  432. will exit if
  433. <link anchor="continue-after-fatal">setExitOnFirstFatalError</link>
  434. is set to true.</td></tr>
  435. <tr><th><em>see:</em></th><td>
  436. <link anchor="continue-after-fatal">setExitOnFirstFatalError</link>
  437. </td></tr>
  438. </table>
  439. <p/>
  440. <anchor name="use-cached"/>
  441. <table>
  442. <tr><th colspan="2"><em>void useCachedGrammarInParse(const bool)</em></th></tr>
  443. <tr><th><em>true:</em></th><td>Use cached grammar if it exists in the pool.</td></tr>
  444. <tr><th><em>false:</em></th><td>Parse the schema grammar.</td></tr>
  445. <tr><th><em>default:</em></th><td> false </td></tr>
  446. <tr><th><em>note:</em></th><td>The getter function for this method is called isUsingCachedGrammarInParse.</td></tr>
  447. <tr><th><em>note:</em></th><td>If the grammar caching option is enabled, this option is set to true automatically and
  448. any setting to this option by the user is a no-op.</td></tr>
  449. <tr><th><em>see:</em></th><td>
  450. <link anchor="cache-grammar">cacheGrammarFromParse</link>
  451. </td></tr>
  452. </table>
  453. <p/>
  454. <anchor name="cache-grammar"/>
  455. <table>
  456. <tr><th colspan="2"><em>void cacheGrammarFromParse(const bool)</em></th></tr>
  457. <tr><th><em>true:</em></th><td>Cache the grammar in the pool for re-use in subsequent parses.</td></tr>
  458. <tr><th><em>false:</em></th><td>Do not cache the grammar in the pool</td></tr>
  459. <tr><th><em>default:</em></th><td> false </td></tr>
  460. <tr><th><em>note:</em></th><td>The getter function for this method is called isCachingGrammarFromParse</td></tr>
  461. <tr><th><em>note:</em></th><td> If set to true, the useCachedGrammarInParse
  462. is also set to true automatically.</td></tr>
  463. <tr><th><em>see:</em></th><td>
  464. <link anchor="use-cached">useCachedGrammarInParse</link>
  465. </td></tr>
  466. </table>
  467. <p/>
  468. <anchor name="StandardUriConformant"/>
  469. <table>
  470. <tr><th colspan="2"><em>void setStandardUriConformant(const bool)</em></th></tr>
  471. <tr><th><em>true:</em></th><td> Force standard uri conformance. </td></tr>
  472. <tr><th><em>false:</em></th><td> Do not force standard uri conformance. </td></tr>
  473. <tr><th><em>default:</em></th><td> false </td></tr>
  474. <tr><th><em>note:</em></th><td> If set to true, malformed uri will be rejected
  475. and fatal error will be issued. </td></tr>
  476. </table>
  477. <p/>
  478. <anchor name="CalculateSrcOffset"/>
  479. <table>
  480. <tr><th colspan="2"><em>void setCalculateSrcOfs(const bool)</em></th></tr>
  481. <tr><th><em>true:</em></th><td> Enable source offset calculation. </td></tr>
  482. <tr><th><em>false:</em></th><td> Disable source offset calculation. </td></tr>
  483. <tr><th><em>default:</em></th><td> false </td></tr>
  484. <tr><th><em>note:</em></th><td> If set to true, the user can inquire about
  485. the current source offset within the input source. Setting it to false (default)
  486. improves the performance.</td></tr>
  487. </table>
  488. <p/>
  489. <anchor name="IdentityConstraintChecking"/>
  490. <table>
  491. <tr><th colspan="2"><em>void setIdentityConstraintChecking(const bool);</em></th></tr>
  492. <tr><th><em>true:</em></th><td> Enable identity constraint checking. </td></tr>
  493. <tr><th><em>false:</em></th><td> Disable identity constraint checking. </td></tr>
  494. <tr><th><em>default:</em></th><td> true </td></tr>
  495. </table>
  496. <p/>
  497. <anchor name="GenerateSyntheticAnnotations"/>
  498. <table>
  499. <tr><th colspan="2"><em>void setGenerateSyntheticAnnotations(const bool);</em></th></tr>
  500. <tr><th><em>true:</em></th><td> Enable generation of synthetic annotations. A synthetic annotation will be
  501. generated when a schema component has non-schema attributes but no child annotation. </td></tr>
  502. <tr><th><em>false:</em></th><td> Disable generation of synthetic annotations. </td></tr>
  503. <tr><th><em>default:</em></th><td> false </td></tr>
  504. </table>
  505. <p/>
  506. <anchor name="XercesValidateAnnotations"/>
  507. <table>
  508. <tr><th colspan="2"><em>setValidateAnnotation</em></th></tr>
  509. <tr><th><em>true:</em></th><td> Enable validation of annotations. </td></tr>
  510. <tr><th><em>false:</em></th><td> Disable validation of annotations. </td></tr>
  511. <tr><th><em>default:</em></th><td> false </td></tr>
  512. <tr><th><em>note:</em></th><td> Each annotation is validated independently. </td></tr>
  513. </table>
  514. <p/>
  515. <anchor name="IgnoreAnnotations"/>
  516. <table>
  517. <tr><th colspan="2"><em>setIgnoreAnnotations</em></th></tr>
  518. <tr><th><em>true:</em></th><td> Do not generate XSAnnotations when traversing a schema.</td></tr>
  519. <tr><th><em>false:</em></th><td> Generate XSAnnotations when traversing a schema.</td></tr>
  520. <tr><th><em>default:</em></th><td> false </td></tr>
  521. </table>
  522. <p/>
  523. <anchor name="DisableDefaultEntityResolution"/>
  524. <table>
  525. <tr><th colspan="2"><em>setDisableDefaultEntityResolution</em></th></tr>
  526. <tr><th><em>true:</em></th><td> The parser will not attempt to resolve the entity when the resolveEntity method returns NULL.</td></tr>
  527. <tr><th><em>false:</em></th><td> The parser will attempt to resolve the entity when the resolveEntity method returns NULL.</td></tr>
  528. <tr><th><em>default:</em></th><td> false </td></tr>
  529. </table>
  530. <p/>
  531. <anchor name="SkipDTDValidation"/>
  532. <table>
  533. <tr><th colspan="2"><em>setSkipDTDValidation</em></th></tr>
  534. <tr><th><em>true:</em></th><td> When schema validation is on the parser will ignore the DTD, except for entities.</td></tr>
  535. <tr><th><em>false:</em></th><td> The parser will not ignore DTDs when validating.</td></tr>
  536. <tr><th><em>default:</em></th><td> false </td></tr>
  537. <tr><th><em>see:</em></th><td>
  538. <link anchor="schema">DoSchema</link></td></tr>
  539. </table>
  540. <p/>
  541. <anchor name="XercesIgnoreCachedDTD"/>
  542. <table>
  543. <tr><th colspan="2"><em>setIgnoreCachedDTD</em></th></tr>
  544. <tr><th><em>true:</em></th><td> Ignore a cached DTD when an XML document contains both an
  545. internal and external DTD, and the use cached grammar from parse option
  546. is enabled. Currently, we do not allow using cached DTD grammar when an
  547. internal subset is present in the document. This option will only affect
  548. the behavior of the parser when an internal and external DTD both exist
  549. in a document (i.e. no effect if document has no internal subset).</td></tr>
  550. <tr><th><em>false:</em></th><td> Don't ignore cached DTD. </td></tr>
  551. <tr><th><em>default:</em></th><td> false </td></tr>
  552. <tr><th><em>see:</em></th><td>
  553. <link anchor="use-cached">useCachedGrammarInParse</link></td></tr>
  554. </table>
  555. <p/>
  556. <anchor name="XercesHandleMultipleImports"/>
  557. <table>
  558. <tr><th colspan="2"><em>setHandleMultipleImports</em></th></tr>
  559. <tr><th><em>true:</em></th><td> During schema validation allow multiple schemas with the same namespace
  560. to be imported.</td></tr>
  561. <tr><th><em>false:</em></th><td> Don't import multiple schemas with the same namespace. </td></tr>
  562. <tr><th><em>default:</em></th><td> false </td></tr>
  563. </table>
  564. <p/>
  565. <anchor name="CreateSchemaInfo"/>
  566. <table>
  567. <tr><th colspan="2"><em>setCreateSchemaInfo</em></th></tr>
  568. <tr><th><em>true:</em></th><td> Enable storing of PSVI information in element and attribute nodes. </td></tr>
  569. <tr><th><em>false:</em></th><td> Disable storing of PSVI information in element and attribute nodes. </td></tr>
  570. <tr><th><em>default:</em></th><td> false </td></tr>
  571. </table>
  572. <p/>
  573. <anchor name="CreateCommentNodes"/>
  574. <table>
  575. <tr><th colspan="2"><em>setCreateCommentNodes</em></th></tr>
  576. <tr><th><em>true:</em></th><td> Enable the parser to create comment nodes in the DOM tree being produced.</td></tr>
  577. <tr><th><em>false:</em></th><td> Disable comment nodes being produced. </td></tr>
  578. <tr><th><em>default:</em></th><td> true </td></tr>
  579. </table>
  580. <p/>
  581. </s3>
  582. <anchor name="XercesDOMProperties"/>
  583. <s3 title="XercesDOMParser Supported Properties">
  584. <p>The behavior of the XercesDOMParser is dependent on the values of the following properties. All
  585. of the properties below are set using the "setter" methods (e.g. <code>setExternalSchemaLocation</code>),
  586. and are queried using the corresponding "getter" methods (e.g. <code>getExternalSchemaLocation</code>).
  587. The following only gives you a quick summary of supported features. Please
  588. refer to <jump href="api-&XercesC3Series;.html">API Documentation</jump> for
  589. complete details.
  590. </p>
  591. <table>
  592. <tr><th colspan="2"><em>void setExternalSchemaLocation(const XMLCh*)</em></th></tr>
  593. <tr><th><em>Description</em></th><td> The XML Schema Recommendation explicitly states that
  594. the inclusion of schemaLocation/ noNamespaceSchemaLocation attributes in the
  595. instance document is only a hint; it does not mandate that these attributes
  596. must be used to locate schemas. Similar situation happens to &lt;import&gt;
  597. element in schema documents. This property allows the user to specify a list
  598. of schemas to use. If the targetNamespace of a schema specified using this
  599. method matches the targetNamespace of a schema occurring in the instance
  600. document in schemaLocation attribute, or
  601. if the targetNamespace matches the namespace attribute of &lt;import&gt;
  602. element, the schema specified by the user using this property will
  603. be used (i.e., the schemaLocation attribute in the instance document
  604. or on the &lt;import&gt; element will be effectively ignored).</td></tr>
  605. <tr><th><em>Value</em></th><td> The syntax is the same as for schemaLocation attributes
  606. in instance documents: e.g, "http://www.example.com file_name.xsd".
  607. The user can specify more than one XML Schema in the list.</td></tr>
  608. <tr><th><em>Value Type</em></th><td> XMLCh* </td></tr>
  609. </table>
  610. <p/>
  611. <table>
  612. <tr><th colspan="2"><em>void setExternalNoNamespaceSchemaLocation(const XMLCh* const)</em></th></tr>
  613. <tr><th><em>Description</em></th><td> The XML Schema Recommendation explicitly states that
  614. the inclusion of schemaLocation/ noNamespaceSchemaLocation attributes in the
  615. instance document is only a hint; it does not mandate that these attributes
  616. must be used to locate schemas. This property allows the user to specify the
  617. no target namespace XML Schema Location externally. If specified, the instance
  618. document's noNamespaceSchemaLocation attribute will be effectively ignored.</td></tr>
  619. <tr><th><em>Value</em></th><td> The syntax is the same as for the noNamespaceSchemaLocation
  620. attribute that may occur in an instance document: e.g."file_name.xsd".</td></tr>
  621. <tr><th><em>Value Type</em></th><td> XMLCh* </td></tr>
  622. </table>
  623. <p/>
  624. <table>
  625. <tr><th colspan="2"><em>void useScanner(const XMLCh* const)</em></th></tr>
  626. <tr><th><em>Description</em></th><td> This property allows the user to specify the name of
  627. the XMLScanner to use for scanning XML documents. If not specified, the default
  628. scanner "IGXMLScanner" is used.</td></tr>
  629. <tr><th><em>Value</em></th><td> The recognized scanner names are: <br/>
  630. 1."WFXMLScanner" - scanner that performs well-formedness checking only.<br/>
  631. 2. "DGXMLScanner" - scanner that handles XML documents with DTD grammar information.<br/>
  632. 3. "SGXMLScanner" - scanner that handles XML documents with XML schema grammar information.<br/>
  633. 4. "IGXMLScanner" - scanner that handles XML documents with DTD or/and XML schema grammar information.<br/>
  634. Users can use the predefined constants defined in XMLUni directly (fgWFXMLScanner, fgDGXMLScanner,
  635. fgSGXMLScanner, or fgIGXMLScanner) or a string that matches the value of
  636. one of those constants.</td></tr>
  637. <tr><th><em>Value Type</em></th><td> XMLCh* </td></tr>
  638. <tr><th><em>note: </em></th><td> See <jump href="program-others-&XercesC3Series;.html#UseSpecificScanner">Use Specific Scanner</jump>
  639. for more programming details. </td></tr>
  640. </table>
  641. <p/>
  642. <table>
  643. <tr><th colspan="2"><em>void useImplementation(const XMLCh* const)</em></th></tr>
  644. <tr><th><em>Description</em></th><td>This property allows the user to specify a set of features
  645. which the parser will then use to acquire an implementation from which it will create
  646. the DOMDocument to use when reading in an XML file.</td></tr>
  647. <tr><th><em>Value Type</em></th><td> XMLCh* </td></tr>
  648. </table>
  649. <p/>
  650. <p/>
  651. <table>
  652. <tr><th
  653. colspan="2"><em>setSecurityManager(Security Manager * const)</em></th></tr>
  654. <tr><th><em>Description</em></th>
  655. <td>
  656. Certain valid XML and XML Schema constructs can force a
  657. processor to consume more system resources than an
  658. application may wish. In fact, certain features could
  659. be exploited by malicious document writers to produce a
  660. denial-of-service attack. This property allows
  661. applications to impose limits on the amount of
  662. resources the processor will consume while processing
  663. these constructs.
  664. </td></tr>
  665. <tr><th><em>Value</em></th>
  666. <td>
  667. An instance of the SecurityManager class (see
  668. <code>xercesc/util/SecurityManager</code>). This
  669. class's documentation describes the particular limits
  670. that may be set. Note that, when instantiated, default
  671. values for limits that should be appropriate in most
  672. settings are provided. The default implementation is
  673. not thread-safe; if thread-safety is required, the
  674. application should extend this class, overriding
  675. methods appropriately. The parser will not adopt the
  676. SecurityManager instance; the application is
  677. responsible for deleting it when it is finished with
  678. it. If no SecurityManager instance has been provided to
  679. the parser (the default) then processing strictly
  680. conforming to the relevant specifications will be
  681. performed.
  682. </td></tr>
  683. <tr><th><em>Value Type</em></th><td> SecurityManager* </td></tr>
  684. </table>
  685. <p/>
  686. <table>
  687. <tr><th
  688. colspan="2"><em>setLowWaterMark(XMLSize_t)</em></th></tr>
  689. <tr><th><em>Description</em></th>
  690. <td>
  691. If the number of available bytes in the raw buffer is less than
  692. the low water mark the parser will attempt to read more data before
  693. continuing parsing. By default the value for this parameter is 100
  694. bytes. You may want to set this parameter to 0 if you would like
  695. the parser to parse the available data immediately without
  696. potentially blocking while waiting for more date.
  697. </td></tr>
  698. <tr><th><em>Value</em></th>
  699. <td>
  700. New low water mark.
  701. </td></tr>
  702. <tr><th><em>Value Type</em></th><td> XMLSize_t </td></tr>
  703. </table>
  704. <p/>
  705. </s3>
  706. </s2>
  707. <anchor name="DOMLSParser"/>
  708. <s2 title="DOMLSParser">
  709. <anchor name="ConstructDOMLSParser"/>
  710. <s3 title="Constructing a DOMLSParser">
  711. <p>DOMLSParser is a new interface introduced by the
  712. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/">
  713. W3C DOM Level 3.0 Load and Save Specification</jump>.
  714. DOMLSParser provides the "Load" interface for parsing XML documents and building the
  715. corresponding DOM document tree from various input sources.
  716. </p>
  717. <p>A DOMLSParser instance is obtained from the DOMImplementationLS interface by invoking
  718. its createLSParser method. For example:
  719. </p>
  720. <source>
  721. #include &lt;xercesc/dom/DOM.hpp>
  722. #include &lt;xercesc/util/XMLString.hpp>
  723. #include &lt;xercesc/util/PlatformUtils.hpp>
  724. #include &lt;iostream>
  725. using namespace std;
  726. using namespace xercesc;
  727. int main (int argc, char* args[]) {
  728. try {
  729. XMLPlatformUtils::Initialize();
  730. }
  731. catch (const XMLException&amp; toCatch) {
  732. char* message = XMLString::transcode(toCatch.getMessage());
  733. cout &lt;&lt; "Error during initialization! :\n"
  734. &lt;&lt; message &lt;&lt; "\n";
  735. XMLString::release(&amp;message);
  736. return 1;
  737. }
  738. XMLCh tempStr[100];
  739. XMLString::transcode("LS", tempStr, 99);
  740. DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
  741. DOMLSParser* parser = ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0);
  742. // optionally you can set some features on this builder
  743. if (parser->getDomConfig()->canSetParameter(XMLUni::fgDOMValidate, true))
  744. parser->getDomConfig()->setParameter(XMLUni::fgDOMValidate, true);
  745. if (parser->getDomConfig()->canSetParameter(XMLUni::fgDOMNamespaces, true))
  746. parser->getDomConfig()->setParameter(XMLUni::fgDOMNamespaces, true);
  747. if (parser->getDomConfig()->canSetParameter(XMLUni::fgDOMDatatypeNormalization, true))
  748. parser->getDomConfig()->setParameter(XMLUni::fgDOMDatatypeNormalization, true);
  749. // optionally you can implement your DOMErrorHandler (e.g. MyDOMErrorHandler)
  750. // and set it to the builder
  751. MyDOMErrorHandler* errHandler = new myDOMErrorHandler();
  752. parser->getDomConfig()->setParameter(XMLUni::fgDOMErrorHandler, errHandler);
  753. char* xmlFile = "x1.xml";
  754. DOMDocument *doc = 0;
  755. try {
  756. doc = parser->parseURI(xmlFile);
  757. }
  758. catch (const XMLException&amp; toCatch) {
  759. char* message = XMLString::transcode(toCatch.getMessage());
  760. cout &lt;&lt; "Exception message is: \n"
  761. &lt;&lt; message &lt;&lt; "\n";
  762. XMLString::release(&amp;message);
  763. return -1;
  764. }
  765. catch (const DOMException&amp; toCatch) {
  766. char* message = XMLString::transcode(toCatch.msg);
  767. cout &lt;&lt; "Exception message is: \n"
  768. &lt;&lt; message &lt;&lt; "\n";
  769. XMLString::release(&amp;message);
  770. return -1;
  771. }
  772. catch (...) {
  773. cout &lt;&lt; "Unexpected Exception \n" ;
  774. return -1;
  775. }
  776. parser->release();
  777. delete errHandler;
  778. return 0;
  779. }
  780. </source>
  781. <p>Please refer to the <jump href="api-&XercesC3Series;.html">API Documentation</jump> and the sample
  782. DOMCount for more detail.
  783. </p>
  784. </s3>
  785. <anchor name="InputSourceWrapper"/>
  786. <s3 title="How to interchange DOMLSInput and SAX InputSource?">
  787. <p>DOM L3 has introduced a DOMLSInput which is similar to the SAX InputSource. The &XercesCName; internals
  788. (XMLScanner, Reader, etc.) use the SAX InputSource to process the xml data. In order to support DOM L3, we need
  789. to provide a mechanism to allow the &XercesCName; internals to talk to a DOMLSInput object. Similarly, &XercesCName;
  790. provides some framework classes for specialized types of input source (i.e. LocalFileInputSource, etc.) that are
  791. derived from the SAX InputSource. In DOM L3, to allow users implementing their own DOMLSResourceResolver(s), which return
  792. a DOMLSInput, to utilize these framework classes, we need to provide a mechanism to map a SAX InputSource to a
  793. DOMLSInput. Two wrapper classes are available to interchange DOMLSInput and SAX InputSource:
  794. </p>
  795. <s4 title="Wrapper4DOMLSInput">
  796. <p>
  797. Wraps a DOMLSInput object to a SAX InputSource.
  798. </p>
  799. <source>
  800. #include &lt;xercesc/dom/DOMLSInput.hpp>
  801. #include &lt;xercesc/framework/Wrapper4DOMLSInput.hpp>
  802. class DBInputSource: public DOMLSInput
  803. {
  804. ...
  805. };
  806. ...
  807. DOMLSInput *domIS = new DBInputSource;
  808. Wrapper4DOMLSInput domISWrapper(domIS);
  809. XercesDOMParser parser;
  810. parser.parse(domISWrapper);
  811. </source>
  812. </s4>
  813. <s4 title="Wrapper4InputSource">
  814. <p>
  815. Wraps a SAX InputSource object to a DOMLSInput.
  816. </p>
  817. <source>
  818. #include &lt;xercesc/framework/Wrapper4InputSource.hpp>
  819. #include &lt;xercesc/framework/LocalFileInputSource.hpp>
  820. DOMLSInput* MyEntityResolver::resolveResource( const XMLCh* const resourceType
  821. , const XMLCh* const namespaceUri
  822. , const XMLCh* const publicId
  823. , const XMLCh* const systemId
  824. , const XMLCh* const baseURI)
  825. {
  826. return new Wrapper4InputSource(new LocalFileInputSource(baseURI, systemId));
  827. }
  828. </source>
  829. </s4>
  830. <p>Please refer to the <jump href="api-&XercesC3Series;.html">API Documentation</jump> for more detail.
  831. </p>
  832. </s3>
  833. <anchor name="DOMLSParserFeatures"/>
  834. <s3 title="DOMLSParser Supported Features">
  835. <p>The behavior of the DOMLSParser is dependent on the values of the following features.
  836. All of the features below can be set using the function <code>DOMLSParser::getDomConfig()->setParameter(cons XMLCh* , bool)</code>.
  837. And can be queried using the function <code>bool DOMLSParser::getDomConfig()->getParameter(const XMLCh* const)</code>.
  838. User can also call <code>DOMLSParser::getDomConfig()->canSetParameter(const XMLCh* , bool)</code>
  839. to query whether setting a feature to a specific value is supported
  840. </p>
  841. <s4 title="DOM Features">
  842. <table>
  843. <tr><th colspan="2"><em>cdata-sections</em></th></tr>
  844. <tr><th><em>true:</em></th><td> Keep CDATASection nodes in the document. </td></tr>
  845. <tr><th><em>false:</em></th><td> Not Supported. </td></tr>
  846. <tr><th><em>default:</em></th><td> true </td></tr>
  847. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMCDATASections </td></tr>
  848. <tr><th><em>note:</em></th><td> Setting this feature to false is not supported. </td></tr>
  849. <tr><th><em>see:</em></th><td>
  850. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  851. DOM Level 3.0 Load and Save Specification</jump>
  852. </td></tr>
  853. </table>
  854. <p/>
  855. <table>
  856. <tr><th colspan="2"><em>comments</em></th></tr>
  857. <tr><th><em>true:</em></th><td> Keep Comment nodes in the document. </td></tr>
  858. <tr><th><em>false:</em></th><td> Discard Comment nodes in the document. </td></tr>
  859. <tr><th><em>default:</em></th><td> true </td></tr>
  860. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMComments </td></tr>
  861. <tr><th><em>see:</em></th><td>
  862. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  863. DOM Level 3.0 Load and Save Specification</jump>
  864. </td></tr>
  865. </table>
  866. <p/>
  867. <table>
  868. <tr><th colspan="2"><em>charset-overrides-xml-encoding</em></th></tr>
  869. <tr><th><em>true:</em></th><td> If a higher level protocol such as HTTP [IETF RFC 2616]
  870. provides an indication of the character encoding of the input stream being processed,
  871. that will override any encoding specified in the XML declaration or the Text declaration
  872. (see also [XML 1.0] 4.3.3 "Character Encoding in Entities"). Explicitly setting an
  873. encoding in the DOMInputSource overrides encodings from the protocol. </td></tr>
  874. <tr><th><em>false:</em></th><td> Any character set encoding information from higher
  875. level protocols is ignored by the parser. </td></tr>
  876. <tr><th><em>default:</em></th><td> true </td></tr>
  877. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMCharsetOverridesXMLEncoding </td></tr>
  878. <tr><th><em>see:</em></th><td>
  879. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  880. DOM Level 3.0 Load and Save Specification</jump>
  881. </td></tr>
  882. </table>
  883. <p/>
  884. <table>
  885. <tr><th colspan="2"><em>datatype-normalization</em></th></tr>
  886. <tr><th><em>true:</em></th><td> Let the validation process do its datatype normalization
  887. that is defined in the used schema language. </td></tr>
  888. <tr><th><em>false:</em></th><td> Disable datatype normalization.
  889. The XML 1.0 attribute value normalization always occurs though. </td></tr>
  890. <tr><th><em>default:</em></th><td> false </td></tr>
  891. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMDatatypeNormalization </td></tr>
  892. <tr><th><em>note:</em></th><td> Note that setting this feature to true does not affect
  893. the DTD normalization operation which always takes place, in accordance to
  894. <jump href="http://www.w3.org/TR/2000/REC-xml-20001006">XML 1.0 (Second Edition)</jump>.
  895. </td></tr>
  896. <tr><th><em>see:</em></th><td>
  897. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  898. DOM Level 3.0 Load and Save Specification</jump>
  899. </td></tr>
  900. <tr><th><em>see:</em></th><td>
  901. <jump href="http://www.w3.org/TR/2000/REC-xml-20001006">XML 1.0 (Second Edition)</jump>.
  902. </td></tr>
  903. </table>
  904. <p/>
  905. <table>
  906. <tr><th colspan="2"><em>entities</em></th></tr>
  907. <tr><th><em>true:</em></th><td> Create EntityReference nodes in the DOM tree. The
  908. EntityReference nodes and their child nodes will be read-only. </td></tr>
  909. <tr><th><em>false:</em></th><td> Do not create EntityReference nodes in the DOM tree. No
  910. EntityReference nodes will be created, only the nodes corresponding to their fully
  911. expanded substitution text will be created. </td></tr>
  912. <tr><th><em>default:</em></th><td> true </td></tr>
  913. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMEntities </td></tr>
  914. <tr><th><em>note:</em></th><td> This feature only affects the appearance of
  915. EntityReference nodes in the DOM tree. The document will always contain the entity
  916. reference child nodes. </td></tr>
  917. <tr><th><em>see:</em></th><td>
  918. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  919. DOM Level 3.0 Load and Save Specification</jump>
  920. </td></tr>
  921. </table>
  922. <p/>
  923. <table>
  924. <tr><th colspan="2"><em>canonical-form</em></th></tr>
  925. <tr><th><em>true:</em></th><td> Not Supported. </td></tr>
  926. <tr><th><em>false:</em></th><td> Do not canonicalize the document. </td></tr>
  927. <tr><th><em>default:</em></th><td> false </td></tr>
  928. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMCanonicalForm </td></tr>
  929. <tr><th><em>note:</em></th><td> Setting this feature to true is not supported. </td></tr>
  930. <tr><th><em>see:</em></th><td>
  931. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  932. DOM Level 3.0 Load and Save Specification</jump>
  933. </td></tr>
  934. </table>
  935. <p/>
  936. <table>
  937. <tr><th colspan="2"><em>infoset</em></th></tr>
  938. <tr><th><em>true:</em></th><td> Not Supported. </td></tr>
  939. <tr><th><em>false:</em></th><td> No effect. </td></tr>
  940. <tr><th><em>default:</em></th><td> false </td></tr>
  941. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMInfoset </td></tr>
  942. <tr><th><em>note:</em></th><td> Setting this feature to true is not supported. </td></tr>
  943. <tr><th><em>see:</em></th><td>
  944. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  945. DOM Level 3.0 Load and Save Specification</jump>
  946. </td></tr>
  947. </table>
  948. <p/>
  949. <anchor name="builder-namespaces"/>
  950. <table>
  951. <tr><th colspan="2"><em>namespaces</em></th></tr>
  952. <tr><th><em>true:</em></th><td> Perform Namespace processing </td></tr>
  953. <tr><th><em>false:</em></th><td> Do not perform Namespace processing</td></tr>
  954. <tr><th><em>default:</em></th><td> true </td></tr>
  955. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMNamespaces </td></tr>
  956. <tr><th><em>note:</em></th><td> If the validation is on, then the
  957. document must contain a grammar that supports the use of namespaces </td></tr>
  958. <tr><th><em>see:</em></th><td>
  959. <link anchor="builder-validation">validation</link>
  960. </td></tr>
  961. <tr><th><em>see:</em></th><td>
  962. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  963. DOM Level 3.0 Load and Save Specification</jump>
  964. </td></tr>
  965. </table>
  966. <p/>
  967. <table>
  968. <tr><th colspan="2"><em>namespace-declarations</em></th></tr>
  969. <tr><th><em>true:</em></th><td> Include namespace declaration attributes,
  970. specified or defaulted from the schema or the DTD, in the document. </td></tr>
  971. <tr><th><em>false:</em></th><td> Not Supported. </td></tr>
  972. <tr><th><em>default:</em></th><td> true </td></tr>
  973. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMNamespaceDeclarations </td></tr>
  974. <tr><th><em>note:</em></th><td> Setting this feature to false is not supported. </td></tr>
  975. <tr><th><em>see:</em></th><td>
  976. <link anchor="builder-namespaces">namespaces</link>
  977. </td></tr>
  978. <tr><th><em>see:</em></th><td>
  979. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  980. DOM Level 3.0 Load and Save Specification</jump>
  981. </td></tr>
  982. </table>
  983. <p/>
  984. <table>
  985. <tr><th colspan="2"><em>supported-mediatypes-only</em></th></tr>
  986. <tr><th><em>true:</em></th><td> Not Supported. </td></tr>
  987. <tr><th><em>false:</em></th><td> Don't check the media type, accept any type of data. </td></tr>
  988. <tr><th><em>default:</em></th><td> false </td></tr>
  989. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMSupportedMediatypesOnly </td></tr>
  990. <tr><th><em>note:</em></th><td> Setting this feature to true is not supported. </td></tr>
  991. <tr><th><em>see:</em></th><td>
  992. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  993. DOM Level 3.0 Load and Save Specification</jump>
  994. </td></tr>
  995. </table>
  996. <p/>
  997. <anchor name="builder-validate-if-schema"/>
  998. <table>
  999. <tr><th colspan="2"><em>validate-if-schema</em></th></tr>
  1000. <tr><th><em>true:</em></th><td> When validation is true, the parser will validate the document only if a grammar is specified.</td></tr>
  1001. <tr><th><em>false:</em></th><td> Validation is determined by the state of the
  1002. <link anchor="builder-validation">validation</link> feature. </td></tr>
  1003. <tr><th><em>default:</em></th><td> false </td></tr>
  1004. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMValidateIfSchema </td></tr>
  1005. <tr><th><em>see:</em></th><td>
  1006. <link anchor="builder-validation">validation</link>
  1007. </td></tr>
  1008. <tr><th><em>see:</em></th><td>
  1009. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  1010. DOM Level 3.0 Load and Save Specification</jump>
  1011. </td></tr>
  1012. </table>
  1013. <p/>
  1014. <anchor name="builder-validation"/>
  1015. <table>
  1016. <tr><th colspan="2"><em>validation</em></th></tr>
  1017. <tr><th><em>true:</em></th><td> Report all validation errors. </td></tr>
  1018. <tr><th><em>false:</em></th><td> Do not report validation errors. </td></tr>
  1019. <tr><th><em>default:</em></th><td> false </td></tr>
  1020. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMValidate </td></tr>
  1021. <tr><th><em>note:</em></th><td> If this feature is set to true, the document must
  1022. specify a grammar. If this feature is set to false and document specifies a grammar,
  1023. that grammar might be parsed but no validation of the document contents will be
  1024. performed. </td></tr>
  1025. <tr><th><em>see:</em></th><td>
  1026. <link anchor="builder-validate-if-schema">validate-if-schema</link>
  1027. </td></tr>
  1028. <tr><th><em>see:</em></th><td>
  1029. <link anchor="builder-load-external-dtd">http://apache.org/xml/features/nonvalidating/load-external-dtd</link>
  1030. </td></tr>
  1031. <tr><th><em>see:</em></th><td>
  1032. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  1033. DOM Level 3.0 Load and Save Specification</jump>
  1034. </td></tr>
  1035. </table>
  1036. <p/>
  1037. <anchor name="builder-whitespace"/>
  1038. <table>
  1039. <tr><th colspan="2"><em>whitespace-in-element-content</em></th></tr>
  1040. <tr><th><em>true:</em></th><td> Include text nodes that can be considered "ignorable
  1041. whitespace" in the DOM tree. </td></tr>
  1042. <tr><th><em>false:</em></th><td> Do not include ignorable whitespace in the DOM tree. </td></tr>
  1043. <tr><th><em>default:</em></th><td> true </td></tr>
  1044. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMElementContentWhitespace </td></tr>
  1045. <tr><th><em>note:</em></th><td> The only way that the parser can determine if text is
  1046. ignorable is by reading the associated grammar and having a content model for the
  1047. document. When ignorable whitespace text nodes are included in the DOM tree,
  1048. they will be flagged as ignorable; and the method DOMText::isIgnorableWhitespace()
  1049. will return true for those text nodes. </td></tr>
  1050. <tr><th><em>see:</em></th><td>
  1051. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  1052. DOM Level 3.0 Load and Save Specification</jump>
  1053. </td></tr>
  1054. </table>
  1055. </s4>
  1056. <s4 title="Xerces Features">
  1057. <anchor name="builder-schema"/>
  1058. <table>
  1059. <tr><th colspan="2"><em>http://apache.org/xml/features/validation/schema</em></th></tr>
  1060. <tr><th><em>true:</em></th><td> Enable the parser's schema support. </td></tr>
  1061. <tr><th><em>false:</em></th><td> Disable the parser's schema support. </td></tr>
  1062. <tr><th><em>default:</em></th><td> false </td></tr>
  1063. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesSchema </td></tr>
  1064. <tr><th><em>note</em></th><td> If set to true, namespace processing must also be turned on. </td></tr>
  1065. <tr><th><em>see:</em></th><td>
  1066. <link anchor="builder-namespaces">namespaces</link>
  1067. </td></tr>
  1068. </table>
  1069. <p/>
  1070. <table>
  1071. <tr><th colspan="2"><em>http://apache.org/xml/features/validation/schema-full-checking</em></th></tr>
  1072. <tr><th><em>true:</em></th><td> Enable full schema constraint checking, including checking
  1073. which may be time-consuming or memory intensive. Currently, particle unique
  1074. attribution constraint checking and particle derivation restriction checking
  1075. are controlled by this option. </td></tr>
  1076. <tr><th><em>false:</em></th><td> Disable full schema constraint checking. </td></tr>
  1077. <tr><th><em>default:</em></th><td> false </td></tr>
  1078. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesSchemaFullChecking </td></tr>
  1079. <tr><th><em>note:</em></th><td> This feature checks the Schema grammar itself for
  1080. additional errors that are time-consuming or memory intensive. It does <em>not</em> affect the
  1081. level of checking performed on document instances that use Schema grammars. </td></tr>
  1082. <tr><th><em>see:</em></th><td>
  1083. <link anchor="builder-schema">http://apache.org/xml/features/validation/schema</link>
  1084. </td></tr>
  1085. </table>
  1086. <p/>
  1087. <anchor name="builder-load-schema"/>
  1088. <table>
  1089. <tr><th colspan="2"><em>http://apache.org/xml/features/validating/load-schema</em></th></tr>
  1090. <tr><th><em>true:</em></th><td> Load the schema. </td></tr>
  1091. <tr><th><em>false:</em></th><td> Don't load the schema if it wasn't found in the grammar pool. </td></tr>
  1092. <tr><th><em>default:</em></th><td> true </td></tr>
  1093. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesLoadSchema </td></tr>
  1094. <tr><th><em>note:</em></th><td> This feature is ignored and no schemas are loaded if schema processing is disabled. </td></tr>
  1095. <tr><th><em>see:</em></th><td>
  1096. <link anchor="builder-schema">schema</link>
  1097. </td></tr>
  1098. </table>
  1099. <p/>
  1100. <anchor name="builder-load-external-dtd"/>
  1101. <table>
  1102. <tr><th colspan="2"><em>http://apache.org/xml/features/nonvalidating/load-external-dtd</em></th></tr>
  1103. <tr><th><em>true:</em></th><td> Load the External DTD. </td></tr>
  1104. <tr><th><em>false:</em></th><td> Ignore the external DTD completely. </td></tr>
  1105. <tr><th><em>default:</em></th><td> true </td></tr>
  1106. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesLoadExternalDTD </td></tr>
  1107. <tr><th><em>note</em></th><td> This feature is ignored and DTD is always loaded when validation is on. </td></tr>
  1108. <tr><th><em>see:</em></th><td>
  1109. <link anchor="builder-validation">validation</link>
  1110. </td></tr>
  1111. </table>
  1112. <p/>
  1113. <anchor name="builder-continue-after-fatal"/>
  1114. <table>
  1115. <tr><th colspan="2"><em>http://apache.org/xml/features/continue-after-fatal-error</em></th></tr>
  1116. <tr><th><em>true:</em></th><td> Attempt to continue parsing after a fatal error. </td></tr>
  1117. <tr><th><em>false:</em></th><td> Stops parse on first fatal error. </td></tr>
  1118. <tr><th><em>default:</em></th><td> false </td></tr>
  1119. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesContinueAfterFatalError </td></tr>
  1120. <tr><th><em>note:</em></th><td> The behavior of the parser when this feature is set to
  1121. true is <em>undetermined</em>! Therefore use this feature with extreme caution because
  1122. the parser may get stuck in an infinite loop or worse. </td></tr>
  1123. </table>
  1124. <p/>
  1125. <table>
  1126. <tr><th colspan="2"><em>http://apache.org/xml/features/validation-error-as-fatal</em></th></tr>
  1127. <tr><th><em>true:</em></th><td> The parser will treat validation error as fatal and will
  1128. exit depends on the state of
  1129. <link anchor="builder-continue-after-fatal">http://apache.org/xml/features/continue-after-fatal-error</link>.
  1130. </td></tr>
  1131. <tr><th><em>false:</em></th><td> The parser will report the error and continue processing. </td></tr>
  1132. <tr><th><em>default:</em></th><td> false </td></tr>
  1133. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesValidationErrorAsFatal </td></tr>
  1134. <tr><th><em>note:</em></th><td> Setting this true does not mean the validation error will
  1135. be printed with the word "Fatal Error". It is still printed as "Error", but the parser
  1136. will exit if
  1137. <link anchor="builder-continue-after-fatal">http://apache.org/xml/features/continue-after-fatal-error</link>
  1138. is set to false. </td></tr>
  1139. <tr><th><em>see:</em></th><td>
  1140. <link anchor="builder-continue-after-fatal">http://apache.org/xml/features/continue-after-fatal-error</link>
  1141. </td></tr>
  1142. </table>
  1143. <p/>
  1144. <anchor name="builder-use-cached"/>
  1145. <table>
  1146. <tr><th colspan="2"><em>http://apache.org/xml/features/validation/use-cachedGrammarInParse</em></th></tr>
  1147. <tr><th><em>true:</em></th><td>Use cached grammar if it exists in the pool.</td></tr>
  1148. <tr><th><em>false:</em></th><td>Parse the schema grammar.</td></tr>
  1149. <tr><th><em>default:</em></th><td> false </td></tr>
  1150. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesUseCachedGrammarInParse </td></tr>
  1151. <tr><th><em>note:</em></th><td>If http://apache.org/xml/features/validation/cache-grammarFromParse is enabled,
  1152. this feature is set to true automatically and any setting to this feature by the user is a no-op.</td></tr>
  1153. <tr><th><em>see:</em></th><td>
  1154. <link anchor="builder-cache-grammar">http://apache.org/xml/features/validation/cache-grammarFromParse</link>
  1155. </td></tr>
  1156. </table>
  1157. <p/>
  1158. <anchor name="builder-cache-grammar"/>
  1159. <table>
  1160. <tr><th colspan="2"><em>http://apache.org/xml/features/validation/cache-grammarFromParse</em></th></tr>
  1161. <tr><th><em>true:</em></th><td>Cache the grammar in the pool for re-use in subsequent parses.</td></tr>
  1162. <tr><th><em>false:</em></th><td>Do not cache the grammar in the pool</td></tr>
  1163. <tr><th><em>default:</em></th><td> false </td></tr>
  1164. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesCacheGrammarFromParse </td></tr>
  1165. <tr><th><em>note:</em></th><td> If set to true, the http://apache.org/xml/features/validation/use-cachedGrammarInParse
  1166. is also set to true automatically.</td></tr>
  1167. <tr><th><em>see:</em></th><td>
  1168. <link anchor="builder-use-cached">http://apache.org/xml/features/validation/use-cachedGrammarInParse</link>
  1169. </td></tr>
  1170. </table>
  1171. <p/>
  1172. <anchor name="builder-StandardUriConformant"/>
  1173. <table>
  1174. <tr><th colspan="2"><em>http://apache.org/xml/features/standard-uri-conformant</em></th></tr>
  1175. <tr><th><em>true:</em></th><td> Force standard uri conformance. </td></tr>
  1176. <tr><th><em>false:</em></th><td> Do not force standard uri conformance. </td></tr>
  1177. <tr><th><em>default:</em></th><td> false </td></tr>
  1178. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesStandardUriConformant </td></tr>
  1179. <tr><th><em>note:</em></th><td> If set to true, malformed uri will be rejected
  1180. and fatal error will be issued. </td></tr>
  1181. </table>
  1182. <p/>
  1183. <anchor name="builder-CalculateSrcOffset"/>
  1184. <table>
  1185. <tr><th colspan="2"><em>http://apache.org/xml/features/calculate-src-ofs</em></th></tr>
  1186. <tr><th><em>true:</em></th><td> Enable source offset calculation. </td></tr>
  1187. <tr><th><em>false:</em></th><td> Disable source offset calculation. </td></tr>
  1188. <tr><th><em>default:</em></th><td> false </td></tr>
  1189. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesCalculateSrcOfs </td></tr>
  1190. <tr><th><em>note:</em></th><td> If set to true, the user can inquire about
  1191. the current source offset within the input source. Setting it to false (default)
  1192. improves the performance.</td></tr>
  1193. </table>
  1194. <p/>
  1195. <anchor name="builder-IdentityConstraintChecking"/>
  1196. <table>
  1197. <tr><th colspan="2"><em>http://apache.org/xml/features/validation/identity-constraint-checking</em></th></tr>
  1198. <tr><th><em>true:</em></th><td> Enable identity constraint checking. </td></tr>
  1199. <tr><th><em>false:</em></th><td> Disable identity constraint checking. </td></tr>
  1200. <tr><th><em>default:</em></th><td> true </td></tr>
  1201. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesIdentityConstraintChecking </td></tr>
  1202. </table>
  1203. <p/>
  1204. <anchor name="builder-GenerateSyntheticAnnotations"/>
  1205. <table>
  1206. <tr><th colspan="2"><em>http://apache.org/xml/features/generate-synthetic-annotations</em></th></tr>
  1207. <tr><th><em>true:</em></th><td> Enable generation of synthetic annotations. A synthetic annotation will be
  1208. generated when a schema component has non-schema attributes but no child annotation. </td></tr>
  1209. <tr><th><em>false:</em></th><td> Disable generation of synthetic annotations. </td></tr>
  1210. <tr><th><em>default:</em></th><td> false </td></tr>
  1211. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesGenerateSyntheticAnnotations </td></tr>
  1212. </table>
  1213. <p/>
  1214. <anchor name="builder-XercesValidateAnnotations"/>
  1215. <table>
  1216. <tr><th colspan="2"><em>http://apache.org/xml/features/validate-annotations</em></th></tr>
  1217. <tr><th><em>true:</em></th><td> Enable validation of annotations. </td></tr>
  1218. <tr><th><em>false:</em></th><td> Disable validation of annotations. </td></tr>
  1219. <tr><th><em>default:</em></th><td> false </td></tr>
  1220. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesValidateAnnotations </td></tr>
  1221. <tr><th><em>note:</em></th><td> Each annotation is validated independently. </td></tr>
  1222. </table>
  1223. <p/>
  1224. <anchor name="builder-IgnoreAnnotations"/>
  1225. <table>
  1226. <tr><th colspan="2"><em>http://apache.org/xml/features/schema/ignore-annotations</em></th></tr>
  1227. <tr><th><em>true:</em></th><td> Do not generate XSAnnotations when traversing a schema.</td></tr>
  1228. <tr><th><em>false:</em></th><td> Generate XSAnnotations when traversing a schema.</td></tr>
  1229. <tr><th><em>default:</em></th><td> false </td></tr>
  1230. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesIgnoreAnnotations </td></tr>
  1231. </table>
  1232. <p/>
  1233. <anchor name="builder-DisableDefaultEntityResolution"/>
  1234. <table>
  1235. <tr><th colspan="2"><em>http://apache.org/xml/features/disable-default-entity-resolution</em></th></tr>
  1236. <tr><th><em>true:</em></th><td> The parser will not attempt to resolve the entity when the resolveEntity method returns NULL.</td></tr>
  1237. <tr><th><em>false:</em></th><td> The parser will attempt to resolve the entity when the resolveEntity method returns NULL.</td></tr>
  1238. <tr><th><em>default:</em></th><td> false </td></tr>
  1239. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesDisableDefaultEntityResolution </td></tr>
  1240. </table>
  1241. <p/>
  1242. <anchor name="builder-SkipDTDValidation"/>
  1243. <table>
  1244. <tr><th colspan="2"><em>http://apache.org/xml/features/validation/schema/skip-dtd-validation</em></th></tr>
  1245. <tr><th><em>true:</em></th><td> When schema validation is on the parser will ignore the DTD, except for entities.</td></tr>
  1246. <tr><th><em>false:</em></th><td> The parser will not ignore DTDs when validating.</td></tr>
  1247. <tr><th><em>default:</em></th><td> false </td></tr>
  1248. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesSkipDTDValidation </td></tr>
  1249. <tr><th><em>see:</em></th><td>
  1250. <link anchor="builder-schema">Schema Validation</link></td></tr>
  1251. </table>
  1252. <p/>
  1253. <anchor name="builder-IgnoreCachedDTD"/>
  1254. <table>
  1255. <tr><th colspan="2"><em>http://apache.org/xml/features/validation/ignoreCachedDTD</em></th></tr>
  1256. <tr><th><em>true:</em></th><td> Ignore a cached DTD when an XML document contains both an
  1257. internal and external DTD, and the use cached grammar from parse option
  1258. is enabled. Currently, we do not allow using cached DTD grammar when an
  1259. internal subset is present in the document. This option will only affect
  1260. the behavior of the parser when an internal and external DTD both exist
  1261. in a document (i.e. no effect if document has no internal subset).</td></tr>
  1262. <tr><th><em>false:</em></th><td> Don't ignore cached DTD. </td></tr>
  1263. <tr><th><em>default:</em></th><td> false </td></tr>
  1264. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesIgnoreCachedDTD </td></tr>
  1265. <tr><th><em>see:</em></th><td>
  1266. <link anchor="builder-use-cached">http://apache.org/xml/features/validation/use-cachedGrammarInParse</link>
  1267. </td></tr>
  1268. </table>
  1269. <p/>
  1270. <anchor name="builder-HandleMultipleImports"/>
  1271. <table>
  1272. <tr><th colspan="2"><em>http://apache.org/xml/features/validation/schema/handle-multiple-imports</em></th></tr>
  1273. <tr><th><em>true:</em></th><td> During schema validation allow multiple schemas with the same namespace
  1274. to be imported.</td></tr>
  1275. <tr><th><em>false:</em></th><td> Don't import multiple schemas with the same namespace. </td></tr>
  1276. <tr><th><em>default:</em></th><td> false </td></tr>
  1277. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesHandleMultipleImports </td></tr>
  1278. </table>
  1279. <p/>
  1280. <anchor name="builder-DOMHasPsviInfo"/>
  1281. <table>
  1282. <tr><th colspan="2"><em>http://apache.org/xml/features/dom-has-psvi-info</em></th></tr>
  1283. <tr><th><em>true:</em></th><td> Enable storing of PSVI information in element and attribute nodes.</td></tr>
  1284. <tr><th><em>false:</em></th><td> Disable storing of PSVI information in element and attribute nodes. </td></tr>
  1285. <tr><th><em>default:</em></th><td> false </td></tr>
  1286. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesDOMHasPSVIInfo </td></tr>
  1287. </table>
  1288. <p/>
  1289. <anchor name="builder-adopts-domdocument"/>
  1290. <table>
  1291. <tr><th colspan="2"><em>http://apache.org/xml/features/dom/user-adopts-DOMDocument</em></th></tr>
  1292. <tr><th><em>true:</em></th><td> The caller will adopt the DOMDocument that is returned from
  1293. the parse method and thus is responsible to call DOMDocument::release() to release the
  1294. associated memory. The parser will not release it. The ownership is transferred
  1295. from the parser to the caller. </td></tr>
  1296. <tr><th><em>false:</em></th><td> The returned DOMDocument from the parse method is owned by
  1297. the parser and thus will be deleted when the parser is released. </td></tr>
  1298. <tr><th><em>default:</em></th><td> false </td></tr>
  1299. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesUserAdoptsDOMDocument </td></tr>
  1300. <tr><th><em>see:</em></th><td>
  1301. <jump href="api-&XercesC3Series;.html">
  1302. DOMLSParser API Documentation</jump>, (DOMLSParser::parse and DOMLSParser::resetDocumentPool)
  1303. </td></tr>
  1304. </table>
  1305. <p/>
  1306. </s4>
  1307. </s3>
  1308. <anchor name="DOMLSParserProperties"/>
  1309. <s3 title="DOMLSParser Supported Properties">
  1310. <p>The behavior of the DOMLSParser is dependent on the values of the following properties.
  1311. All of the properties below can be set using the function <code>DOMLSParser::getDomConfig()->setParameter(const XMLCh* , const void*)</code>.
  1312. It takes a void pointer as the property value. Application is required to initialize this void
  1313. pointer to a correct type. Please check the column "Value Type" below
  1314. to learn exactly what type of property value each property expects for processing.
  1315. Passing a void pointer that was initialized with a wrong type will lead to unexpected result.
  1316. If the same property is set more than once, the last one takes effect.</p>
  1317. <p>Property values can be queried using the function <code>void* DOMLSParser::getDomConfig()->getParameter(const XMLCh* )</code>.
  1318. The parser owns the returned pointer, and the memory allocated for the returned pointer will
  1319. be destroyed when the parser is released. To ensure accessibility of the returned information after
  1320. the parser is released, callers need to copy and store the returned information somewhere else.
  1321. Since the returned pointer is a generic void pointer, check the column "Value Type" below to learn
  1322. exactly what type of object each property returns for replication.</p>
  1323. <s4 title="Xerces Properties">
  1324. <table>
  1325. <tr><th colspan="2"><em>http://apache.org/xml/properties/schema/external-schemaLocation</em></th></tr>
  1326. <tr><th><em>Description</em></th><td> The XML Schema Recommendation explicitly states that
  1327. the inclusion of schemaLocation/ noNamespaceSchemaLocation attributes in the
  1328. instance document is only a hint; it does not mandate that these attributes
  1329. must be used to locate schemas. Similar situation happens to &lt;import&gt;
  1330. element in schema documents. This property allows the user to specify a list
  1331. of schemas to use. If the targetNamespace of a schema specified using this
  1332. method matches the targetNamespace of a schema occurring in the instance
  1333. document in schemaLocation attribute, or
  1334. if the targetNamespace matches the namespace attribute of &lt;import&gt;
  1335. element, the schema specified by the user using this property will
  1336. be used (i.e., the schemaLocation attribute in the instance document
  1337. or on the &lt;import&gt; element will be effectively ignored). </td></tr>
  1338. <tr><th><em>Value</em></th><td> The syntax is the same as for schemaLocation attributes
  1339. in instance documents: e.g, "http://www.example.com file_name.xsd".
  1340. The user can specify more than one XML Schema in the list. </td></tr>
  1341. <tr><th><em>Value Type</em></th><td> XMLCh* </td></tr>
  1342. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesSchemaExternalSchemaLocation </td></tr>
  1343. </table>
  1344. <p/>
  1345. <table>
  1346. <tr><th colspan="2"><em>http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation</em></th></tr>
  1347. <tr><th><em>Description</em></th><td> The XML Schema Recommendation explicitly states that
  1348. the inclusion of schemaLocation/ noNamespaceSchemaLocation attributes in the
  1349. instance document is only a hint; it does not mandate that these attributes
  1350. must be used to locate schemas. This property allows the user to specify the
  1351. no target namespace XML Schema Location externally. If specified, the instance
  1352. document's noNamespaceSchemaLocation attribute will be effectively ignored. </td></tr>
  1353. <tr><th><em>Value</em></th><td> The syntax is the same as for the noNamespaceSchemaLocation
  1354. attribute that may occur in an instance document: e.g."file_name.xsd". </td></tr>
  1355. <tr><th><em>Value Type</em></th><td> XMLCh* </td></tr>
  1356. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesSchemaExternalNoNameSpaceSchemaLocation </td></tr>
  1357. </table>
  1358. <p/>
  1359. <table>
  1360. <tr><th colspan="2"><em>http://apache.org/xml/properties/scannerName</em></th></tr>
  1361. <tr><th><em>Description</em></th><td> This property allows the user to specify the name of
  1362. the XMLScanner to use for scanning XML documents. If not specified, the default
  1363. scanner "IGXMLScanner" is used.</td></tr>
  1364. <tr><th><em>Value</em></th><td> The recognized scanner names are: <br/>
  1365. 1."WFXMLScanner" - scanner that performs well-formedness checking only.<br/>
  1366. 2. "DGXMLScanner" - scanner that handles XML documents with DTD grammar information.<br/>
  1367. 3. "SGXMLScanner" - scanner that handles XML documents with XML schema grammar information.<br/>
  1368. 4. "IGXMLScanner" - scanner that handles XML documents with DTD or/and XML schema grammar information.<br/>
  1369. Users can use the predefined constants defined in XMLUni directly (fgWFXMLScanner, fgDGXMLScanner,
  1370. fgSGXMLScanner, or fgIGXMLScanner) or a string that matches the value of
  1371. one of those constants.</td></tr>
  1372. <tr><th><em>Value Type</em></th><td> XMLCh* </td></tr>
  1373. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesScannerName </td></tr>
  1374. <tr><th><em>note: </em></th><td> See <jump href="program-others-&XercesC3Series;.html#UseSpecificScanner">Use Specific Scanner</jump>
  1375. for more programming details. </td></tr>
  1376. </table>
  1377. <p/>
  1378. <table>
  1379. <tr><th colspan="2"><em>http://apache.org/xml/properties/parser-use-DOMDocument-from-Implementation</em></th></tr>
  1380. <tr><th><em>Description</em></th><td>This property allows the user to specify a set of features
  1381. which the parser will then use to acquire an implementation from which it will create
  1382. the DOMDocument to use when reading in an XML file.</td></tr>
  1383. <tr><th><em>Value Type</em></th><td> XMLCh* </td></tr>
  1384. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesParserUseDocumentFromImplementation </td></tr>
  1385. </table>
  1386. <p/>
  1387. <table>
  1388. <tr><th colspan="2"><em>http://apache.org/xml/properties/security-manager</em></th></tr>
  1389. <tr><th><em>Description</em></th>
  1390. <td>
  1391. Certain valid XML and XML Schema constructs can force a
  1392. processor to consume more system resources than an
  1393. application may wish. In fact, certain features could
  1394. be exploited by malicious document writers to produce a
  1395. denial-of-service attack. This property allows
  1396. applications to impose limits on the amount of
  1397. resources the processor will consume while processing
  1398. these constructs.
  1399. </td></tr>
  1400. <tr><th><em>Value</em></th>
  1401. <td>
  1402. An instance of the SecurityManager class (see
  1403. <code>xercesc/util/SecurityManager</code>). This
  1404. class's documentation describes the particular limits
  1405. that may be set. Note that, when instantiated, default
  1406. values for limits that should be appropriate in most
  1407. settings are provided. The default implementation is
  1408. not thread-safe; if thread-safety is required, the
  1409. application should extend this class, overriding
  1410. methods appropriately. The parser will not adopt the
  1411. SecurityManager instance; the application is
  1412. responsible for deleting it when it is finished with
  1413. it. If no SecurityManager instance has been provided to
  1414. the parser (the default) then processing strictly
  1415. conforming to the relevant specifications will be
  1416. performed.
  1417. </td></tr>
  1418. <tr><th><em>Value Type</em></th><td> SecurityManager* </td></tr>
  1419. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesSecurityManager </td></tr>
  1420. </table>
  1421. <p/>
  1422. <table>
  1423. <tr><th
  1424. colspan="2"><em>http://apache.org/xml/properties/low-water-mark</em></th></tr>
  1425. <tr><th><em>Description</em></th>
  1426. <td>
  1427. If the number of available bytes in the raw buffer is less than
  1428. the low water mark the parser will attempt to read more data before
  1429. continuing parsing. By default the value for this parameter is 100
  1430. bytes. You may want to set this parameter to 0 if you would like
  1431. the parser to parse the available data immediately without
  1432. potentially blocking while waiting for more date.
  1433. </td></tr>
  1434. <tr><th><em>Value</em></th>
  1435. <td>
  1436. New low water mark.
  1437. </td></tr>
  1438. <tr><th><em>Value Type</em></th><td> XMLSize_t* </td></tr>
  1439. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgXercesLowWaterMark </td></tr>
  1440. </table>
  1441. <p/>
  1442. </s4>
  1443. </s3>
  1444. </s2>
  1445. <anchor name="DOMLSSerializer"/>
  1446. <s2 title="DOMLSSerializer">
  1447. <anchor name="ConstructDOMLSSerializer"/>
  1448. <s3 title="Constructing a DOMLSSerializer">
  1449. <p>DOMLSSerializer is a new interface introduced by the
  1450. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/">
  1451. W3C DOM Level 3.0 Load and Save Specification</jump>.
  1452. DOMLSSerializer provides the "Save" interface for serializing (writing) a DOM document into
  1453. XML data. The XML data can be written to various type of output stream.
  1454. </p>
  1455. <p>A DOMLSSerializer instance is obtained from the DOMImplementationLS interface by invoking
  1456. its createLSSerializer method. For example:
  1457. </p>
  1458. <source>
  1459. #include &lt;xercesc/dom/DOM.hpp>
  1460. #include &lt;xercesc/util/XMLString.hpp>
  1461. #include &lt;xercesc/util/PlatformUtils.hpp>
  1462. #include &lt;iostream>
  1463. using namespace std;
  1464. using namespace xercesc;
  1465. int serializeDOM(DOMNode* node) {
  1466. XMLCh tempStr[100];
  1467. XMLString::transcode("LS", tempStr, 99);
  1468. DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
  1469. DOMLSSerializer* theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();
  1470. // optionally you can set some features on this serializer
  1471. if (theSerializer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTDiscardDefaultContent, true))
  1472. theSerializer->getDomConfig()->setParameter(XMLUni::fgDOMWRTDiscardDefaultContent, true);
  1473. if (theSerializer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true))
  1474. theSerializer->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true);
  1475. // optionally you can implement your DOMLSSerializerFilter (e.g. MyDOMLSSerializerFilter)
  1476. // and set it to the serializer
  1477. DOMLSSerializer* myFilter = new myDOMLSSerializerFilter();
  1478. theSerializer->setFilter(myFilter);
  1479. // optionally you can implement your DOMErrorHandler (e.g. MyDOMErrorHandler)
  1480. // and set it to the serializer
  1481. DOMErrorHandler* errHandler = new myDOMErrorHandler();
  1482. theSerializer->getDomConfig()->setParameter(XMLUni::fgDOMErrorHandler, myErrorHandler);
  1483. // StdOutFormatTarget prints the resultant XML stream
  1484. // to stdout once it receives any thing from the serializer.
  1485. XMLFormatTarget *myFormTarget = new StdOutFormatTarget();
  1486. DOMLSOutput* theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
  1487. theOutput->setByteStream(myFormTarget);
  1488. try {
  1489. // do the serialization through DOMLSSerializer::write();
  1490. theSerializer->write(node, theOutput);
  1491. }
  1492. catch (const XMLException&amp; toCatch) {
  1493. char* message = XMLString::transcode(toCatch.getMessage());
  1494. cout &lt;&lt; "Exception message is: \n"
  1495. &lt;&lt; message &lt;&lt; "\n";
  1496. XMLString::release(&amp;message);
  1497. return -1;
  1498. }
  1499. catch (const DOMException&amp; toCatch) {
  1500. char* message = XMLString::transcode(toCatch.msg);
  1501. cout &lt;&lt; "Exception message is: \n"
  1502. &lt;&lt; message &lt;&lt; "\n";
  1503. XMLString::release(&amp;message);
  1504. return -1;
  1505. }
  1506. catch (...) {
  1507. cout &lt;&lt; "Unexpected Exception \n" ;
  1508. return -1;
  1509. }
  1510. theOutput->release();
  1511. theSerializer->release();
  1512. delete myErrorHandler;
  1513. delete myFilter;
  1514. delete myFormTarget;
  1515. return 0;
  1516. }
  1517. </source>
  1518. <p>Please refer to the <jump href="api-&XercesC3Series;.html">API Documentation</jump> and the sample
  1519. DOMPrint for more detail.
  1520. </p>
  1521. </s3>
  1522. <anchor name="DOMLSSerializerEntityRef"/>
  1523. <s3 title="How does DOMLSSerializer handle built-in entity Reference in node value?">
  1524. <p>Say for example you parse the following xml document using XercesDOMParser or DOMLSParser</p>
  1525. <source>
  1526. &lt;root>
  1527. &lt;Test attr=" > ' &amp;lt; &amp;gt; &amp;amp; &amp;quot; &amp;apos; ">&lt;/Test>
  1528. &lt;Test attr=' > " &amp;lt; &amp;gt; &amp;amp; &amp;quot; &amp;apos; '>&lt;/Test>
  1529. &lt;Test> > " ' &amp;lt; &amp;gt; &amp;amp; &amp;quot; &amp;apos; &lt;/Test>
  1530. &lt;Test>&lt;![CDATA[&lt; > &amp; " ' &amp;lt; &amp;gt; &amp;amp; &amp;quot; &amp;apos; ] ]&gt;&lt;/Test>
  1531. &lt;/root>
  1532. </source>
  1533. <p>According to XML 1.0 spec, 4.4 XML Processor Treatment of Entities and References, the parser
  1534. will expand the entity reference as follows</p>
  1535. <source>
  1536. &lt;root>
  1537. &lt;Test attr=" > ' &lt; &gt; &amp; &quot; &apos; ">&lt;/Test>
  1538. &lt;Test attr=' > " &lt; &gt; &amp; &quot; &apos; '>&lt;/Test>
  1539. &lt;Test> > " ' &lt; &gt; &amp; &quot; &apos; &lt;/Test>
  1540. &lt;Test>&lt;![CDATA[&lt; > &amp; " ' &amp;lt; &amp;gt; &amp;amp; &amp;quot; &amp;apos; ] ]&gt;&lt;/Test>
  1541. &lt;/root>
  1542. </source>
  1543. <p>and pass such DOMNode to DOMLSSerializer for serialization. From DOMLSSerializer perspective, it
  1544. does not know what the original string was. All it sees is above DOMNode from the
  1545. parser. But since the DOMLSSerializer is supposed to generate something that is parsable if sent
  1546. back to the parser, it cannot print such string as is. Thus the DOMLSSerializer is doing some
  1547. "touch up", just enough, to get the string parsable.</p>
  1548. <p>So for example since the appearance of &lt; and &amp; in text value will lead to
  1549. not well-form XML error, the DOMLSSerializer fixes them to &amp;lt; and &amp;amp;
  1550. respectively; while the >, ' and " in text value are ok to the parser, so DOMLSSerializer does not
  1551. do anything to them. Similarly the DOMLSSerializer fixes some of the characters for the attribute value
  1552. but keep everything in CDATA.</p>
  1553. <p>So the string that is generated by DOMLSSerializer will look like this</p>
  1554. <source>
  1555. &lt;root>
  1556. &lt;Test attr=" > ' &amp;lt; > &amp;amp; &amp;quot; ' "/>
  1557. &lt;Test attr=" > &amp;quot; &amp;lt; > &amp;amp; &amp;quot; ' "/>
  1558. &lt;Test> > " ' &amp;lt; > &amp;amp; " ' &lt;/Test>
  1559. &lt;Test>&lt;![CDATA[&lt; > &amp; " ' &amp;lt; &amp;gt; &amp;amp; &amp;quot; &amp;apos; ] ]&gt;&lt;/Test>
  1560. &lt;/root>
  1561. </source>
  1562. <p>Below is the table that summarizes how built-in entity reference are handled for
  1563. different DOM node types:</p>
  1564. <table>
  1565. <tr>
  1566. <th><em>Input/Output</em></th>
  1567. <th><em>&lt;</em></th>
  1568. <th><em>&gt;</em></th>
  1569. <th><em>&amp;</em></th>
  1570. <th><em>&quot;</em></th>
  1571. <th><em>&apos;</em></th>
  1572. <th><em>&amp;lt;</em></th>
  1573. <th><em>&amp;gt;</em></th>
  1574. <th><em>&amp;amp;</em></th>
  1575. <th><em>&amp;quot;</em></th>
  1576. <th><em>&amp;apos;</em></th>
  1577. </tr>
  1578. <tr>
  1579. <td><em>Attribute</em></td>
  1580. <td>N/A</td>
  1581. <td>&gt;</td>
  1582. <td>N/A</td>
  1583. <td>&amp;quot;</td>
  1584. <td>&apos;</td>
  1585. <td>&amp;lt;</td>
  1586. <td>&gt;</td>
  1587. <td>&amp;amp;</td>
  1588. <td>&amp;quot;</td>
  1589. <td>&apos;</td>
  1590. </tr>
  1591. <tr>
  1592. <td><em>Text</em></td>
  1593. <td>N/A</td>
  1594. <td>&gt;</td>
  1595. <td>N/A</td>
  1596. <td>&quot;</td>
  1597. <td>&apos;</td>
  1598. <td>&amp;lt;</td>
  1599. <td>&gt;</td>
  1600. <td>&amp;amp;</td>
  1601. <td>&quot;</td>
  1602. <td>&apos;</td>
  1603. </tr>
  1604. <tr>
  1605. <td><em>CDATA</em></td>
  1606. <td>&lt;</td>
  1607. <td>&gt;</td>
  1608. <td>&amp;</td>
  1609. <td>&quot;</td>
  1610. <td>&apos;</td>
  1611. <td>&amp;lt;</td>
  1612. <td>&amp;gt;</td>
  1613. <td>&amp;amp;</td>
  1614. <td>&amp;quot;</td>
  1615. <td>&amp;apos;</td>
  1616. </tr>
  1617. </table>
  1618. </s3>
  1619. <anchor name="DOMLSSerializerFeatures"/>
  1620. <s3 title="DOMLSSerializer Supported Features">
  1621. <p>The behavior of the DOMLSSerializer is dependent on the values of the following features.
  1622. All of the features below can be set using the function <code>DOMLSSerializer::getDomConfig()->setParameter(cons XMLCh* , bool)</code>.
  1623. And can be queried using the function <code>bool DOMLSSerializer::getDomConfig()->getParameter(const XMLCh* const)</code>.
  1624. User can also call <code>DOMLSSerializer::getDomConfig()->canSetParameter(const XMLCh* , bool)</code>
  1625. to query whether setting a feature to a specific value is supported
  1626. </p>
  1627. <s4 title="DOM Features">
  1628. <table>
  1629. <tr><th colspan="2"><em>discard-default-content</em></th></tr>
  1630. <tr><th><em>true:</em></th><td> Use whatever information available to the implementation
  1631. (i.e. XML schema, DTD, the specified flag on Attr nodes, and so on) to decide what
  1632. attributes and content should be discarded or not. </td></tr>
  1633. <tr><th><em>false:</em></th><td> Keep all attributes and all content. </td></tr>
  1634. <tr><th><em>default:</em></th><td> true </td></tr>
  1635. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMWRTDiscardDefaultContent </td></tr>
  1636. <tr><th><em>note:</em></th><td> Note that the specified flag on Attr nodes in itself
  1637. is not always reliable, it is only reliable when it is set to false since the only case
  1638. where it can be set to false is if the attribute was created by the implementation. The
  1639. default content won't be removed if an implementation does not have any information
  1640. available. </td></tr>
  1641. <tr><th><em>see:</em></th><td>
  1642. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/">
  1643. DOM Level 3.0 Load and Save Specification</jump>
  1644. </td></tr>
  1645. </table>
  1646. <p/>
  1647. <table>
  1648. <tr><th colspan="2"><em>entities</em></th></tr>
  1649. <tr><th><em>true:</em></th><td> EntityReference nodes are serialized as an entity
  1650. reference of the form "&amp;entityName;" in the output. </td></tr>
  1651. <tr><th><em>false:</em></th><td> EntityReference nodes are serialized as expanded
  1652. substitution text, unless the corresponding entity definition is not found. </td></tr>
  1653. <tr><th><em>default:</em></th><td> true </td></tr>
  1654. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMWRTEntities </td></tr>
  1655. <tr><th><em>note:</em></th><td> This feature only affects the output XML stream.
  1656. The DOM tree to be serialized will not be changed. </td></tr>
  1657. <tr><th><em>see:</em></th><td>
  1658. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  1659. DOM Level 3.0 Load and Save Specification</jump>
  1660. </td></tr>
  1661. </table>
  1662. <p/>
  1663. <anchor name="writer-canonical"/>
  1664. <table>
  1665. <tr><th colspan="2"><em>canonical-form</em></th></tr>
  1666. <tr><th><em>true:</em></th><td> Not Supported. </td></tr>
  1667. <tr><th><em>false:</em></th><td> Do not canonicalize the output. </td></tr>
  1668. <tr><th><em>default:</em></th><td> false </td></tr>
  1669. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMWRTCanonicalForm </td></tr>
  1670. <tr><th><em>note:</em></th><td> Setting this feature to true is not supported. </td></tr>
  1671. <tr><th><em>see:</em></th><td>
  1672. <link anchor="writer-pretty">format-pretty-print</link>
  1673. </td></tr>
  1674. <tr><th><em>see:</em></th><td>
  1675. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  1676. DOM Level 3.0 Load and Save Specification</jump>
  1677. </td></tr>
  1678. </table>
  1679. <p/>
  1680. <anchor name="writer-pretty"/>
  1681. <table>
  1682. <tr><th colspan="2"><em>format-pretty-print</em></th></tr>
  1683. <tr><th><em>true:</em></th><td> Formatting the output by adding whitespace to produce
  1684. a pretty-printed, indented, human-readable form. The exact form of the transformations
  1685. is not specified by this specification. </td></tr>
  1686. <tr><th><em>false:</em></th><td> Don't pretty-print the result. </td></tr>
  1687. <tr><th><em>default:</em></th><td> false </td></tr>
  1688. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMWRTFormatPrettyPrint </td></tr>
  1689. <tr><th><em>note:</em></th><td> Setting this feature to true will set the feature
  1690. <link anchor="writer-canonical">canonical-form</link> to false. </td></tr>
  1691. <tr><th><em>see:</em></th><td>
  1692. <link anchor="writer-canonical">canonical-form</link>
  1693. </td></tr>
  1694. <tr><th><em>see:</em></th><td>
  1695. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  1696. DOM Level 3.0 Load and Save Specification</jump>
  1697. </td></tr>
  1698. </table>
  1699. <p/>
  1700. <table>
  1701. <tr><th colspan="2"><em>normalize-characters</em></th></tr>
  1702. <tr><th><em>true:</em></th><td> Not Supported. </td></tr>
  1703. <tr><th><em>false:</em></th><td> Do not perform character normalization. </td></tr>
  1704. <tr><th><em>note:</em></th><td> Setting this feature to true is not supported. </td></tr>
  1705. <tr><th><em>default:</em></th><td> false </td></tr>
  1706. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMWRTNormalizeCharacters </td></tr>
  1707. <tr><th><em>see:</em></th><td>
  1708. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  1709. DOM Level 3.0 Load and Save Specification</jump>
  1710. </td></tr>
  1711. </table>
  1712. <p/>
  1713. <table>
  1714. <tr><th colspan="2"><em>split-cdata-sections</em></th></tr>
  1715. <tr><th><em>true:</em></th><td> Split CDATA sections containing the CDATA section
  1716. termination marker ']]&gt;', or unrepresentable characters in the output encoding.
  1717. When a CDATA section is split a warning is issued. </td></tr>
  1718. <tr><th><em>false:</em></th><td> Signal an error if a CDATASection contains
  1719. CDATA section termination marker ']]&gt;', or an unrepresentable character. </td></tr>
  1720. <tr><th><em>default:</em></th><td> true </td></tr>
  1721. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMWRTSplitCdataSections </td></tr>
  1722. <tr><th><em>see:</em></th><td>
  1723. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  1724. DOM Level 3.0 Load and Save Specification</jump>
  1725. </td></tr>
  1726. </table>
  1727. <p/>
  1728. <table>
  1729. <tr><th colspan="2"><em>validation</em></th></tr>
  1730. <tr><th><em>true:</em></th><td> Not Supported. </td></tr>
  1731. <tr><th><em>false:</em></th><td> Do not report validation errors. </td></tr>
  1732. <tr><th><em>note:</em></th><td> Setting this feature to true is not supported. </td></tr>
  1733. <tr><th><em>default:</em></th><td> false </td></tr>
  1734. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMWRTValidation </td></tr>
  1735. <tr><th><em>see:</em></th><td>
  1736. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  1737. DOM Level 3.0 Load and Save Specification</jump>
  1738. </td></tr>
  1739. </table>
  1740. <p/>
  1741. <table>
  1742. <tr><th colspan="2"><em>whitespace-in-element-content</em></th></tr>
  1743. <tr><th><em>true:</em></th><td> Include text nodes that can be considered "ignorable
  1744. whitespace" in the DOM tree. </td></tr>
  1745. <tr><th><em>false:</em></th><td> Not Supported. </td></tr>
  1746. <tr><th><em>note:</em></th><td> Setting this feature to false is not supported. </td></tr>
  1747. <tr><th><em>default:</em></th><td> true </td></tr>
  1748. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMWRTWhitespaceInElementContent </td></tr>
  1749. <tr><th><em>see:</em></th><td>
  1750. <jump href="http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407">
  1751. DOM Level 3.0 Load and Save Specification</jump>
  1752. </td></tr>
  1753. </table>
  1754. <p/>
  1755. <table>
  1756. <tr><th colspan="2"><em>xml declaration</em></th></tr>
  1757. <tr><th><em>true:</em></th><td> Include xml declaration. </td></tr>
  1758. <tr><th><em>false:</em></th><td> Do not include xml declaration. </td></tr>
  1759. <tr><th><em>default:</em></th><td> true </td></tr>
  1760. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMXMLDeclaration </td></tr>
  1761. </table>
  1762. <p/>
  1763. </s4>
  1764. <s4 title="Xerces Features">
  1765. <anchor name="byte-order-mark"/>
  1766. <table>
  1767. <tr><th colspan="2"><em>byte-order-mark</em></th></tr>
  1768. <tr><th><em>true:</em></th><td> Enable the writing of the Byte-Order-Mark (BOM), in the resultant XML stream.
  1769. </td></tr>
  1770. <tr><th><em>false:</em></th><td> Disable the writing of BOM. </td></tr>
  1771. <tr><th><em>note:</em></th><td> The BOM is written at the beginning of the resultant XML stream,
  1772. if and only if a DOMDocumentNode is rendered for serialization,
  1773. and the output encoding is among the encodings listed here (alias
  1774. acceptable),
  1775. UTF-8, UTF-16, UTF-16LE, UTF-16BE, UCS-4, UCS-4LE, and UCS-4BE.
  1776. In the case of UTF-16/UCS-4, the host machine's endian mode
  1777. is referred to determine the appropriate BOM to be written.
  1778. </td></tr>
  1779. <tr><th><em>default:</em></th><td> false </td></tr>
  1780. <tr><th><em>XMLUni Predefined Constant:</em></th><td> fgDOMWRTBOM </td></tr>
  1781. <tr><th><em>see:</em></th><td>
  1782. <jump href="http://www.w3.org/TR/REC-xml#sec-guessing"> XML 1.0 Appendix F </jump>
  1783. for more information about BOM.
  1784. </td></tr>
  1785. </table>
  1786. </s4>
  1787. </s3>
  1788. </s2>
  1789. </s1>