<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:classref xml:id="class.domdocument" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
 <title>The DOMDocument class</title>
 <titleabbrev>DOMDocument</titleabbrev>
 
 <partintro>
 
<!-- {{{ DOMDocument intro -->
  <section xml:id="domdocument.intro">
   &reftitle.intro;
   <para>
    Represents an entire HTML or XML document; serves as the root of the
    document tree.
   </para>
  </section>
<!-- }}} -->
 
  <section xml:id="domdocument.synopsis">
   &reftitle.classsynopsis;
 
<!-- {{{ Synopsis -->
   <classsynopsis class="class">
    <ooclass>
     <classname>DOMDocument</classname>
    </ooclass>

    <ooclass>
     <modifier>extends</modifier>
     <classname>DOMNode</classname>
    </ooclass>

    <oointerface>
     <modifier>implements</modifier>
     <interfacename>DOMParentNode</interfacename>
    </oointerface>

    <classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>readonly</modifier>
     <type class="union"><type>DOMDocumentType</type><type>null</type></type>
     <varname linkend="domdocument.props.doctype">doctype</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>readonly</modifier>
     <type>DOMImplementation</type>
     <varname linkend="domdocument.props.implementation">implementation</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>readonly</modifier>
     <type class="union"><type>DOMElement</type><type>null</type></type>
     <varname linkend="domdocument.props.documentelement">documentElement</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>readonly</modifier>
     <type class="union"><type>string</type><type>null</type></type>
     <varname linkend="domdocument.props.actualencoding">actualEncoding</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type class="union"><type>string</type><type>null</type></type>
     <varname linkend="domdocument.props.encoding">encoding</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>readonly</modifier>
     <type class="union"><type>string</type><type>null</type></type>
     <varname linkend="domdocument.props.xmlencoding">xmlEncoding</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>bool</type>
     <varname linkend="domdocument.props.standalone">standalone</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>bool</type>
     <varname linkend="domdocument.props.xmlstandalone">xmlStandalone</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type class="union"><type>string</type><type>null</type></type>
     <varname linkend="domdocument.props.version">version</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type class="union"><type>string</type><type>null</type></type>
     <varname linkend="domdocument.props.xmlversion">xmlVersion</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>bool</type>
     <varname linkend="domdocument.props.stricterrorchecking">strictErrorChecking</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type class="union"><type>string</type><type>null</type></type>
     <varname linkend="domdocument.props.documenturi">documentURI</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>readonly</modifier>
     <type>mixed</type>
     <varname linkend="domdocument.props.config">config</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>bool</type>
     <varname linkend="domdocument.props.formatoutput">formatOutput</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>bool</type>
     <varname linkend="domdocument.props.validateonparse">validateOnParse</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>bool</type>
     <varname linkend="domdocument.props.resolveexternals">resolveExternals</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>bool</type>
     <varname linkend="domdocument.props.preservewhitespace">preserveWhiteSpace</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>bool</type>
     <varname linkend="domdocument.props.recover">recover</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <type>bool</type>
     <varname linkend="domdocument.props.substituteentities">substituteEntities</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>readonly</modifier>
     <type class="union"><type>DOMElement</type><type>null</type></type>
     <varname linkend="domdocument.props.firstelementchild">firstElementChild</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>readonly</modifier>
     <type class="union"><type>DOMElement</type><type>null</type></type>
     <varname linkend="domdocument.props.lastelementchild">lastElementChild</varname>
    </fieldsynopsis>
    <fieldsynopsis>
     <modifier>public</modifier>
     <modifier>readonly</modifier>
     <type>int</type>
     <varname linkend="domdocument.props.childelementcount">childElementCount</varname>
    </fieldsynopsis>

    <classsynopsisinfo role="comment">&InheritedProperties;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.domnode')/db:partintro/db:section/db:classsynopsis/db:fieldsynopsis[preceding-sibling::db:classsynopsisinfo[1][@role='comment' and text()='&Properties;']]))">
     <xi:fallback/>
    </xi:include>

    <classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.domdocument')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='DOMDocument'])">
     <xi:fallback/>
    </xi:include>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.domdocument')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='DOMDocument'])">
     <xi:fallback/>
    </xi:include>

    <classsynopsisinfo role="comment">&InheritedMethods;</classsynopsisinfo>
    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.domnode')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='DOMNode'])">
     <xi:fallback/>
    </xi:include>
   </classsynopsis>
<!-- }}} -->
 
  </section>
 
<!-- {{{ DOMDocument properties -->
  <section xml:id="domdocument.props">
   &reftitle.properties;
   <variablelist>
    <varlistentry xml:id="domdocument.props.actualencoding">
     <term><varname>actualEncoding</varname></term>
     <listitem>
      <para>
       <emphasis>Deprecated</emphasis>. Actual encoding of the document,
       is a readonly equivalent to
       <varname linkend="domdocument.props.encoding">encoding</varname>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.childelementcount">
     <term><varname>childElementCount</varname></term>
     <listitem>
      <para>The number of child elements.</para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.config">
     <term><varname>config</varname></term>
     <listitem>
      <para>
       <emphasis>Deprecated</emphasis>. Configuration used when
       <function>DOMDocument::normalizeDocument</function> is
       invoked.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.doctype">
     <term><varname>doctype</varname></term>
     <listitem>
      <para>The Document Type Declaration associated with this document.</para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.documentelement">
     <term><varname>documentElement</varname></term>
     <listitem>
      <para>
       The <classname>DOMElement</classname> object that is the first
       document element. If not found, this evaluates to &null;.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.documenturi">
     <term><varname>documentURI</varname></term>
     <listitem>
      <para>The location of the document or &null; if undefined.</para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.encoding">
     <term><varname>encoding</varname></term>
     <listitem>
      <para>
       Encoding of the document, as specified by the XML declaration. This
       attribute is not present in the final DOM Level 3 specification, but
       is the only way of manipulating XML document encoding in this
       implementation.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.firstelementchild">
     <term><varname>firstElementChild</varname></term>
     <listitem>
      <para>First child element or &null;.</para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.formatoutput">
     <term><varname>formatOutput</varname></term>
     <listitem>
      <para>
       Nicely formats output with indentation and extra space.
       This has no effect if the document was loaded with
       <varname linkend="domdocument.props.preservewhitespace">preserveWhitespace</varname> enabled.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.implementation">
     <term><varname>implementation</varname></term>
     <listitem>
      <para>
       The <classname>DOMImplementation</classname> object that handles 
       this document.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.lastelementchild">
     <term><varname>lastElementChild</varname></term>
     <listitem>
      <para>Last child element or &null;.</para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.preservewhitespace">
     <term><varname>preserveWhiteSpace</varname></term>
     <listitem>
      <para>
       Do not remove redundant white space. Default to &true;.
       Setting this to &false; has the same effect as passing <constant>LIBXML_NOBLANKS</constant>
       as <parameter>option</parameter> to <methodname>DOMDocument::load</methodname> etc.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.recover">
     <term><varname>recover</varname></term>
     <listitem>
      <para>
       <emphasis>Proprietary</emphasis>. Enables recovery mode, i.e. trying
       to parse non-well formed documents. This attribute is not part of
       the DOM specification and is specific to libxml.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.resolveexternals">
     <term><varname>resolveExternals</varname></term>
     <listitem>
      <para>
       Set it to &true; to load external entities from a doctype 
       declaration. This is useful for including character entities in
       your XML document.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.standalone">
     <term><varname>standalone</varname></term>
     <listitem>
      <para>
       <emphasis>Deprecated</emphasis>. Whether or not the document is
       standalone, as specified by the XML declaration, corresponds to
       <varname linkend="domdocument.props.xmlstandalone">xmlStandalone</varname>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.stricterrorchecking">
     <term><varname>strictErrorChecking</varname></term>
     <listitem>
      <para>Throws <classname>DOMException</classname> on errors. Default to &true;.</para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.substituteentities">
     <term><varname>substituteEntities</varname></term>
     <listitem>
      <para>
       <emphasis>Proprietary</emphasis>. Whether or not to substitute
       entities. This attribute is not part of
       the DOM specification and is specific to libxml. Default to &false;.
      </para>
      <caution>
       <simpara>
        Enabling entity substitution may facilitate XML External Entity (XXE) attacks.
       </simpara>
      </caution>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.validateonparse">
     <term><varname>validateOnParse</varname></term>
     <listitem>
      <para>Loads and validates against the DTD. Default to &false;.</para>
      <caution>
       <simpara>
        Enabling validating the DTD may facilitate XML External Entity (XXE) attacks.
       </simpara>
      </caution>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.version">
     <term><varname>version</varname></term>
     <listitem>
      <para>
       <emphasis>Deprecated</emphasis>. Version of XML, corresponds to
       <varname linkend="domdocument.props.xmlversion">xmlVersion</varname>.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.xmlencoding">
     <term><varname>xmlEncoding</varname></term>
     <listitem>
      <para>
       An attribute specifying, as part of the XML declaration, the
       encoding of this document. This is &null; when unspecified or when it
       is not known, such as when the Document was created in memory.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.xmlstandalone">
     <term><varname>xmlStandalone</varname></term>
     <listitem>
      <para>
       An attribute specifying, as part of the XML declaration, whether
       this document is standalone. This is &false; when unspecified.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry xml:id="domdocument.props.xmlversion">
     <term><varname>xmlVersion</varname></term>
     <listitem>
      <para>
       An attribute specifying, as part of the XML declaration, the
       version number of this document. If there is no declaration and if
       this document supports the "XML" feature, the value is "1.0".
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </section>
<!-- }}} -->

  <section role="changelog">
   &reftitle.changelog;
   <informaltable>
    <tgroup cols="2">
     <thead>
      <row>
       <entry>&Version;</entry>
       <entry>&Description;</entry>
      </row>
     </thead>
     <tbody>
      <row>
       <entry>8.0.0</entry>
       <entry>
        <classname>DOMDocument</classname> implements
        <interfacename>DOMParentNode</interfacename> now.
       </entry>
      </row>
      <row>
       <entry>8.0.0</entry>
       <entry>
        The unimplemented method <methodname>DOMDocument::renameNode</methodname>
        has been removed.
       </entry>
      </row>
     </tbody>
    </tgroup>
   </informaltable>
  </section>

<!-- {{{ Notes -->
  <section role="notes">
   &reftitle.notes;
   &dom.note.utf8;
   &dom.note.json;
  </section>
<!-- }}} -->
  
<!-- {{{ See also -->
  <section role="seealso">
   &reftitle.seealso;
   <para>
    <simplelist>
     <member><link xlink:href="&url.spec.dom3.document;">W3C specification for Document</link></member>
    </simplelist>
   </para>
  </section>
<!-- }}} -->
 
 </partintro>
 
 &reference.dom.entities.domdocument;
 
</phpdoc:classref>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
