<commit_before><?xml version="1.0" standalone="no"?>
<!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">

<s1 title="DOM Programming Guide">
    <anchor name="Objectives"/>
    <s2 title="Design Objectives">
      <p>The C++ DOM implementation is based on the
         <jump href="ApacheDOMC++Binding.html">Apache Recommended DOM C++ binding</jump>.</p>
      <p>The design objective aims at meeting the following requirements:
      </p>
      <ul>
      <li>Reduced memory footprint.</li>
      <li>Fast - especially for use in server style and multi-threaded applications.</li>
      <li>Good scalability on multiprocessor systems.</li>
      <li>More C++ like and less Java like.</li>
      </ul>
    </s2>

    <anchor name="DOM3"/>
    <s2 title="DOM Level 3 Support in &XercesCName;">
      <p>The &XercesCName; &XercesCVersion; contains a partial implementation of the W3C
         Document Object Model Level 3.  This implementation is experimental.    See the document
         <jump href="dom3.html"> DOM Level 3 Support</jump> for details.
      </p>
    </s2>

    <anchor name="UsingDOMAPI"/>
    <s2 title="Using DOM API">
       <anchor name="AccessAPI"/>
       <s3 title="Accessing API from application code">

<source>
#include &lt;xercesc/dom/DOM.hpp></source>

      <p>The header file &lt;dom/DOM.hpp&gt; includes all the
        individual headers for the DOM API classes. </p>

       </s3>

       <anchor name="DOMClassNames"/>
       <s3 title="Class Names">
         <p>
           The DOM class names are prefixed with "DOM" (if not already), e.g. "DOMNode". The intent is
           to prevent conflicts between DOM class names and other names
           that may already be in use by an application or other
           libraries that a DOM based application must link with.</p>

         <source>
   DOMDocument*   myDocument;
   DOMNode*       aNode;
   DOMText*       someText;
         </source>

       </s3>

       <anchor name="DOMObjMgmt"/>
       <s3 title="Objects Management">
         <p>Applications would use normal C++ pointers to directly access the
            implementation objects for Nodes in C++ DOM.
         </p>

         <p>Consider the following code snippets</p>


         <source>
   DOMNode*       aNode;
   DOMNode* docRootNode;

   aNode = someDocument->createElement(anElementName);
   docRootNode = someDocument->getDocumentElement();
   docRootNode->appendChild(aNode);
         </source>

      </s3>


       <anchor name="DOMMemMgmt"/>
       <s3 title="Memory Management">
         <p>The C++ DOM implementation provides a release() method for releasing any "orphaned"
         resources that were created through createXXXX factory method.
         Memory for any returned object are owned by implementation.  Please see
         <jump href="ApacheDOMC++Binding.html#release"> Apache Recommended DOM C++ binding</jump>
         for details.</p>

         <s4 title="Objects created by DOMImplementation::createXXXX">
         <p>Users <em>must</em> call the release() function when finished using any objects that
            were created by the DOMImplementation::createXXXX (e.g. DOMBuilder, DOMWriter, DOMDocument,
            DOMDocumentType).</p>

         <p>Acesss to a released object will lead to unexpected behaviour.</p>

         <note>When a DOMDocument is released, all its associated children AND any objects it owned
            (e.g. DOMRange, DOMTreeWalker, DOMNodeIterator or any orphaned nodes) will also be released.
         </note>
         <note>When a DOMDocumentType has been inserted into a DOMDocument and thus has a owner,
            it will then be released automatically when its owner document is released.
         </note>
         </s4>

         <s4 title="Objects created by DOMDocument::createXXXX">
         <p>Users <em>can</em> call the release() function to indicate the release of any orphaned nodes.
            When an orphaned Node is released, its associated children will also be released.
            Acesss to a released Node will lead to unexpected behaviour.   These orphaned Nodes will
            eventually be released, if not already done so, when its owner document is released</p>

            <note>DOMException::INVALID_ACCESS_ERR will be raised if releasing a Node that has a parent
            (has a owner).</note>
         </s4>

         <s4 title="Objects created by DOMDocumentRange::createRange or DOMDocumentTraversal::createXXXX">
         <p>Users <em>can</em> call release() function when finished using the DOMRange,
            DOMNodeIterator, DOMTreeWalker.
            Acesss to a released object will lead to unexpected behaviour.   These objects will
            eventually be released, if not already done so, when its owner document is released
         </p>
         </s4>

         <p>Here is an example</p>
         <source><commit_msg>Documentation update<commit_after><?xml version="1.0" standalone="no"?>
<!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">

<s1 title="DOM Programming Guide">
    <anchor name="Objectives"/>
    <s2 title="Design Objectives">
      <p>The C++ DOM implementation is based on the
         <jump href="ApacheDOMC++Binding.html">Apache Recommended DOM C++ binding</jump>.</p>
      <p>The design objective aims at meeting the following requirements:
      </p>
      <ul>
      <li>Reduced memory footprint.</li>
      <li>Fast - especially for use in server style and multi-threaded applications.</li>
      <li>Good scalability on multiprocessor systems.</li>
      <li>More C++ like and less Java like.</li>
      </ul>
    </s2>

    <anchor name="DOM3"/>
    <s2 title="DOM Level 3 Support in &XercesCName;">
      <p>The &XercesCName; &XercesCVersion; contains a partial implementation of the W3C
         Document Object Model Level 3.  This implementation is experimental.    See the document
         <jump href="dom3.html"> DOM Level 3 Support</jump> for details.
      </p>
    </s2>

    <anchor name="UsingDOMAPI"/>
    <s2 title="Using DOM API">
       <anchor name="AccessAPI"/>
       <s3 title="Accessing API from application code">

<source>
#include &lt;xercesc/dom/DOM.hpp></source>

      <p>The header file &lt;dom/DOM.hpp&gt; includes all the
        individual headers for the DOM API classes. </p>

       </s3>

       <anchor name="DOMClassNames"/>
       <s3 title="Class Names">
         <p>
           The DOM class names are prefixed with "DOM" (if not already), e.g. "DOMNode". The intent is
           to prevent conflicts between DOM class names and other names
           that may already be in use by an application or other
           libraries that a DOM based application must link with.</p>

         <source>
   DOMDocument*   myDocument;
   DOMNode*       aNode;
   DOMText*       someText;
         </source>

       </s3>

       <anchor name="DOMObjMgmt"/>
       <s3 title="Objects Management">
         <p>Applications would use normal C++ pointers to directly access the
            implementation objects for Nodes in C++ DOM.
         </p>

         <p>Consider the following code snippets</p>


         <source>
   DOMNode*       aNode;
   DOMNode* docRootNode;

   aNode = someDocument->createElement(anElementName);
   docRootNode = someDocument->getDocumentElement();
   docRootNode->appendChild(aNode);
         </source>

      </s3>


       <anchor name="DOMMemMgmt"/>
       <s3 title="Memory Management">
         <p>The C++ DOM implementation provides a release() method for releasing any "orphaned"
         resources that were created through createXXXX factory method.
         Memory for any returned object are owned by implementation.  Please see
         <jump href="ApacheDOMC++Binding.html#release"> Apache Recommended DOM C++ binding</jump>
         for details.</p>

         <s4 title="Objects created by DOMImplementation::createXXXX">
         <p>Users <em>must</em> call the release() function when finished using any objects that
            were created by the DOMImplementation::createXXXX (e.g. DOMBuilder, DOMWriter, DOMDocument,
            DOMDocumentType).</p>

         <p>Acesss to a released object will lead to unexpected behaviour.</p>

         <note>When a DOMDocument is released, all its associated children AND any objects it owned
            (e.g. DOMRange, DOMTreeWalker, DOMNodeIterator or any orphaned nodes) will also be released.
         </note>
         <note>When a DOMDocument is cloned, the cloned document has nothing related to the original
            master document and need to be released explicitly.
         </note>
         <note>When a DOMDocumentType has been inserted into a DOMDocument and thus has a owner,
            it will then be released automatically when its owner document is released.
            DOMException::INVALID_ACCESS_ERR will be raised if releasing such owned node.
         </note>
         </s4>

         <s4 title="Objects created by DOMDocument::createXXXX">
         <p>Users <em>can</em> call the release() function to indicate the release of any orphaned nodes.
            When an orphaned Node is released, its associated children will also be released.
            Acesss to a released Node will lead to unexpected behaviour.   These orphaned Nodes will
            eventually be released, if not already done so, when its owner document is released</p>

            <note>DOMException::INVALID_ACCESS_ERR will be raised if releasing a Node that has a parent
            (has a owner).</note>
         </s4>

         <s4 title="Objects created by DOMDocumentRange::createRange or DOMDocumentTraversal::createXXXX">
         <p>Users <em>can</em> call release() function when finished using the DOMRange,
            DOMNodeIterator, DOMTreeWalker.
            Acesss to a released object will lead to unexpected behaviour.   These objects will
            eventually be released, if not already done so, when its owner document is released
         </p>
         </s4>

         <p>Here is an example</p>
         <source>
{'fraction_non_alphanumeric': 0.09183977735811549, 'fraction_numerical': 0.0055660471126130606, 'mean_word_length': 2.5769640952719515, 'pattern_counts': {'":': 0, '<': 183, '<?xml version=': 2, '>': 191, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5173904', 'n_tokens_mistral': 2734, 'n_tokens_neox': 2621, 'n_words': 1050}