<?xml version="1.0" standalone="no"?>
<!--
 * Copyright 1999-2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->

<!DOCTYPE s1 SYSTEM "sbk:/style/dtd/document.dtd">

<s1 title="Programming Guide">

	<p>Independent of the API you want to use, DOM, SAX, or SAX2, your
      application must initialize the &XercesCProjectName; system
      before using the API, and terminate it after you are done. This
      is achieved by the following code:</p>
<source>
#include &lt;xercesc/util/PlatformUtils.hpp&gt;
// Other include files, declarations, and non-&XercesCName; initializations.
XERCES_CPP_NAMESPACE_USE 
  
int main(int argc, char* argv[])
{
  try {
    XMLPlatformUtils::Initialize();
  }
  catch (const XMLException&amp; toCatch) {
    // Do your failure processing here
    return 1;
  }

  // Do your actual work with &XercesCName; here.

  XMLPlatformUtils::Terminate();

  // Other terminations and cleanup.
  return 0;
}</source>


<p><code>XMLPlatformUtils::Initialize()</code> and
         <code>XMLPlatformUtils::Terminate</code> must be called at
         least once in each process. You are allowed to call
         <code>XMLPlatformUtils::Initialize()</code> and
         <code>XMLPlatformUtils::Terminate</code> multiple times, but
         each call to <code>XMLPlatformUtils::Initialize()</code> must
         be matched with a call to
         <code>XMLPlatformUtils::Terminate</code>.</p>

  <s2 title="DOM Programming Guide">
    <p>The DOM API is based on the
      <jump href="ApacheDOMC++Binding.html">Apache Recommended DOM C++ binding</jump>.</p>
    <p>Read the <jump href="program-dom.html">DOM Programming Guide</jump> document
      or jump directly to:</p>
    <ul>
      <li><jump href="program-dom.html#Objectives">Design Objectives</jump></li>
      <li><jump href="program-dom.html#DOM3">DOM Level 3 Support in &XercesCName; </jump></li>
      <li><jump href="program-dom.html#UsingDOMAPI">Using DOM API</jump></li>
      <ul>
          <li><jump href="program-dom.html#AccessAPI">Accessing API from application code</jump></li>
          <li><jump href="program-dom.html#DOMClassNames">Class Names</jump></li>
          <li><jump href="program-dom.html#DOMObjMgmt">Objects Management</jump></li>
          <li><jump href="program-dom.html#DOMMemMgmt">Memory Management</jump></li>
          <li><jump href="program-dom.html#XMLCh">String Type</jump></li>
      </ul>
      <li><jump href="program-dom.html#XercesDOMParser">XercesDOMParser</jump></li>
      <ul>
          <li><jump href="program-dom.html#ConstructXercesDOMParser">Constructing a XercesDOMParser</jump></li>
          <li><jump href="program-dom.html#XercesDOMFeatures">Supported Features</jump></li>
          <li><jump href="program-dom.html#XercesDOMProperties">Supported Properties</jump></li>
      </ul>
      <li><jump href="program-dom.html#DOMBuilder">DOMBuilder</jump></li>
      <ul>
          <li><jump href="program-dom.html#ConstructDOMBuilder">Constructing a DOMBuilder</jump></li>
          <li><jump href="program-dom.html#InputSourceWrapper">How to interchange DOMInputSource and SAX InputSource?</jump></li>
          <li><jump href="program-dom.html#DOMBuilderFeatures">Supported Features</jump></li>
          <li><jump href="program-dom.html#DOMBuilderProperties">Supported Properties</jump></li>
      </ul>
      <li><jump href="program-dom.html#DOMWriter">DOMWriter</jump></li>
      <ul>
          <li><jump href="program-dom.html#ConstructDOMWriter">Constructing a DOMWriter</jump></li>
          <li><jump href="program-dom.html#DOMWriterEntityRef">How does DOMWriter handle built-in entity Reference in node value?</jump></li>
          <li><jump href="program-dom.html#DOMWriterFeatures">Supported Features</jump></li>
      </ul>
      <li><jump href="program-dom.html#Deprecated">Deprecated - Java-like DOM</jump></li>
    </ul>
  </s2>

  <s2 title="SAX Programming Guide">
    <p>Read the <jump href="program-sax.html">SAX Programming Guide</jump> document
      or jump directly to:</p>
    <ul>
      <li><jump href="program-sax.html#UsingSAX1API">Using the SAX API</jump></li>
      <li><jump href="program-sax.html#SAXParser">SAXParser</jump></li>
      <ul>
          <li><jump href="program-sax.html#ConstructParser">Constructing a SAXParser</jump></li>
          <li><jump href="program-sax.html#SAXFeatures">Supported Features</jump></li>
      </ul>
    </ul>
  </s2>

  <s2 title="SAX2 Programming Guide">
    <p>Read the <jump href="program-sax2.html">SAX2 Programming Guide</jump> document
      or jump directly to:</p>
    <ul>
      <li><jump href="program-sax2.html#UsingSAX2API">Using the SAX2 API</jump></li>
      <li><jump href="program-sax2.html#SAX2XMLReader">SAX2XMLReader</jump></li>
      <ul>
          <li><jump href="program-sax2.html#ConstructParser2">Constructing an XML Reader</jump></li>
          <li><jump href="program-sax2.html#SAX2Features">Supported Features</jump></li>
          <li><jump href="program-sax2.html#SAX2Properties">Supported Properties</jump></li>
      </ul>
    </ul>
  </s2>

  <s2 title="Other Features">
    <p>Read the <jump href="program-others.html">&XercesCName; Programming Guide</jump> document
      or jump directly to:</p>
    <ul>
      <li><jump href="program-others.html#Macro">Version Macros</jump></li>
      <li><jump href="program-others.html#Schema">Schema Support</jump></li>
      <li><jump href="program-others.html#Progressive">Progressive Parsing</jump></li>
      <li><jump href="program-others.html#GrammarCache">Preparsing Grammar and Grammar Caching</jump></li>
      <li><jump href="program-others.html#LoadableMessageText">Loadable Message Text</jump></li>
      <li><jump href="program-others.html#PluggableTranscoders">Pluggable Transcoders</jump></li>
      <li><jump href="program-others.html#PortingGuidelines">Porting Guidelines</jump></li>
      <li><jump href="program-others.html#CPPNamespace">Using C++ Namespace</jump></li>
      <li><jump href="program-others.html#SpecifylocaleforMessageLoader">Specify Locale for Message Loader</jump></li>
      <li><jump href="program-others.html#SpecifylocationforMessageLoader">Specify Location for Message Loader</jump></li>
      <li><jump href="program-others.html#UseSpecificScanner">Use Specific Scanner</jump></li>
      <li><jump href="program-others.html#PluggablePanicHandler">Pluggable Panic Handler</jump></li>      
      <li><jump href="program-others.html#PluggableMemoryManager">Pluggable Memory Manager</jump></li>      
      <li><jump href="program-others.html#SecurityManager">Managing Security Vulnerabilities</jump></li>      
    </ul>
  </s2>

</s1>
