php-doc-en/reference/dom/domdocument.xml
2020-02-06 11:44:34 +00:00

380 lines
13 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.domdocument" 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>
<ooclass><classname>DOMDocument</classname></ooclass>
<!-- {{{ Class synopsis -->
<classsynopsisinfo>
<ooclass>
<classname>DOMDocument</classname>
</ooclass>
<!-- If the class extends another one, use this -->
<ooclass>
<modifier>extends</modifier>
<classname>DOMNode</classname>
</ooclass>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&Properties;</classsynopsisinfo>
<!-- If the property is documented below (xml:id=domdocument.props) use this -->
<fieldsynopsis>
<modifier>readonly</modifier>
<modifier>public</modifier>
<type>string</type>
<varname linkend="domdocument.props.actualencoding">actualEncoding</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>readonly</modifier>
<modifier>public</modifier>
<type>DOMConfiguration</type>
<varname linkend="domdocument.props.config">config</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>readonly</modifier>
<modifier>public</modifier>
<type>DOMDocumentType</type>
<varname linkend="domdocument.props.doctype">doctype</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>readonly</modifier>
<modifier>public</modifier>
<type>DOMElement</type>
<varname linkend="domdocument.props.documentelement">documentElement</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<type>string</type>
<varname linkend="domdocument.props.documenturi">documentURI</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<type>string</type>
<varname linkend="domdocument.props.encoding">encoding</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<type>bool</type>
<varname linkend="domdocument.props.formatoutput">formatOutput</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>readonly</modifier>
<modifier>public</modifier>
<type>DOMImplementation</type>
<varname linkend="domdocument.props.implementation">implementation</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<type>bool</type>
<varname linkend="domdocument.props.preservewhitespace">preserveWhiteSpace</varname>
<initializer>&true;</initializer>
</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.resolveexternals">resolveExternals</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.stricterrorchecking">strictErrorChecking</varname>
<initializer>&true;</initializer>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<type>bool</type>
<varname linkend="domdocument.props.substituteentities">substituteEntities</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<type>bool</type>
<varname linkend="domdocument.props.validateonparse">validateOnParse</varname>
<initializer>&false;</initializer>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<type>string</type>
<varname linkend="domdocument.props.version">version</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>readonly</modifier>
<modifier>public</modifier>
<type>string</type>
<varname linkend="domdocument.props.xmlencoding">xmlEncoding</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<type>bool</type>
<varname linkend="domdocument.props.xmlstandalone">xmlStandalone</varname>
</fieldsynopsis>
<fieldsynopsis>
<modifier>public</modifier>
<type>string</type>
<varname linkend="domdocument.props.xmlversion">xmlVersion</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:methodsynopsis[1])" />
<!-- Again, if the class extends a class use this -->
<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[1])" />
</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.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>
This is a convenience attribute that allows direct access to the
child node that is the document element of the document.
</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.formatoutput">
<term><varname>formatOutput</varname></term>
<listitem>
<para>Nicely formats output with indentation and extra space.</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.preservewhitespace">
<term><varname>preserveWhiteSpace</varname></term>
<listitem>
<para>Do not remove redundant white space. Default to &true;.</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.
</para>
</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>
</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>
<!-- }}} -->
<!-- {{{ Notes -->
<section role="notes">
&reftitle.notes;
&dom.note.utf8;
</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
-->