php-doc-en/reference/dom/reference.xml

1403 lines
45 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.36 $ -->
<!-- Purpose: xml -->
<!-- Membership: bundled, external -->
<reference xml:id="ref.dom" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>DOM &Functions;</title>
<partintro>
<section xml:id="dom.intro">
&reftitle.intro;
<para>
The DOM extension allows you to operate on XML documents through the DOM
API with PHP 5.
</para>
<para>
For PHP 4, use <link linkend="ref.domxml">DOM XML</link>.
</para>
<note>
<para>
DOM extension uses UTF-8 encoding. Use <function>utf8_encode</function>
and <function>utf8_decode</function> to work with texts in ISO-8859-1
encoding or <link linkend="ref.iconv">Iconv</link> for other encodings.
</para>
</note>
</section>
<section xml:id="dom.installation">
&reftitle.install;
&no.install;
</section>
<section xml:id='dom.classes'>
&reftitle.classes;
<para>
The API of the module follows the <link
xlink:href="&url.dom3.spec;">DOM Level 3</link> standard as closely
as possible. Consequently, the API is fully object-oriented.
It is a good idea to have the DOM standard available when
using this module.
</para>
<para>
This module defines a number of classes, which are explained in the
following tables. Classes with an equivalent in the DOM standard are
named DOMxxx.
</para>
<section xml:id='dom.class.domattr'>
<title><classname>DOMAttr</classname></title>
<para>
Extends <classname>DOMNode</classname>. The <classname>DOMAttr</classname>
interface represents an attribute in an <classname>DOMElement</classname> object.
</para>
<section xml:id='dom.class.domattr.constructor'>
&reftitle.constructor;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domattr-construct' /> - construct a new DOMAttr object</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domattr.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domattr-isid' /> - Checks if attribute is a defined ID</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domattr.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>name</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>The name of the attribute</entry>
</row>
<row>
<entry>ownerElement</entry>
<entry>DOMElement</entry>
<entry>yes</entry>
<entry>The element which contains the attribute</entry>
</row>
<row>
<entry>schemaTypeInfo</entry>
<entry>bool</entry>
<entry>yes</entry>
<entry>Not implemented yet, always return &null;</entry>
</row>
<row>
<entry>specified</entry>
<entry>bool</entry>
<entry>yes</entry>
<entry>Not implemented yet, always return &null;</entry>
</row>
<row>
<entry>value</entry>
<entry>string</entry>
<entry>no</entry>
<entry>The value of the attribute</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id='dom.class.domcharacterdata'>
<title><classname>DOMCharacterData</classname></title>
<para>
Extends <classname>DOMNode</classname>.
</para>
<section xml:id='dom.class.domcharacterdata.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domcharacterdata-appenddata' /> - Append a string to the end of the character data of the node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domcharacterdata-deletedata' /> - Remove a range of characters from the node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domcharacterdata-insertdata' /> - Insert a string at the specified 16-bit unit offset</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domcharacterdata-replacedata' /> - Replace a substring within the DOMCharacterData node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domcharacterdata-substringdata' /> - Extracts a range of data from the node</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domcharacterdata.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>data</entry>
<entry>string</entry>
<entry>no</entry>
<entry>The contents of the node</entry>
</row>
<row>
<entry>length</entry>
<entry>int</entry>
<entry>yes</entry>
<entry>The length of the contents</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id='dom.class.domcomment'>
<title><classname>DOMComment</classname></title>
<para>
Extends <classname>DOMCharacterData</classname>.
</para>
<section xml:id='dom.class.domcomment.constructor'>
&reftitle.constructor;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domcomment-construct' /> - construct a new DOMComment object</para>
</listitem>
</itemizedlist>
</section>
</section>
<section xml:id='dom.class.domdocument'>
<title><classname>DOMDocument</classname></title>
<para>
Extends <classname>DOMNode</classname>.
</para>
<section xml:id='dom.class.domdocument.constructor'>
&reftitle.constructor;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domdocument-construct' /> - construct a new DOMDocument object</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domdocument.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domdocument-createattribute' /> - Create new attribute</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-createattributens' /> - Create new attribute node with an associated namespace</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-createcdatasection' /> - Create new cdata node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-createcomment' /> - Create new comment node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-createdocumentfragment' /> - Create new document fragment</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-createelement' /> - Create new element node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-createelementns' /> - Create new element node with an associated namespace</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-createentityreference' /> - Create new entity reference node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-createprocessinginstruction' /> - Creates new PI node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-createtextnode' /> - Create new text node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-getelementbyid' /> - Searches for an element with a certain id</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-getelementsbytagname' /> - Searches for all elements with given tag name</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-getelementsbytagnamens' /> - Searches for all elements with given tag name in specified namespace</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-importnode' /> - Import node into current document</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-load' /> - Load XML from a file</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-loadhtml' /> - Load HTML from a string</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-loadhtmlfile' /> - Load HTML from a file</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-loadxml' /> - Load XML from a string</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-normalizedocument' /> - Normalizes the document</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-relaxngvalidate' /> - Performs relaxNG validation on the document</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-relaxngvalidatesource' /> - Performs relaxNG validation on the document</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-registernodeclass' /> - Register extended class used to create base node type (not DOM standard)</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-save' /> - Dumps the internal XML tree back into a file</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-savehtml' /> - Dumps the internal document into a string using HTML formatting</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-savehtmlfile' /> - Dumps the internal document back into a file using HTML formatting</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-savexml' /> - Dumps the internal XML tree back into a string</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-schemavalidate' /> - Validates a document based on a schema</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-schemavalidatesource' /> - Validates a document based on a schema</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-validate' /> - Validates the document based on its DTD</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domdocument-xinclude' /> - Substitutes XIncludes in a DOMDocument Object</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domdocument.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>actualEncoding</entry>
<entry>string</entry>
<entry>yes</entry>
<entry></entry>
</row>
<row>
<entry>config</entry>
<entry>DOMConfiguration</entry>
<entry>yes</entry>
<entry></entry>
</row>
<row>
<entry>doctype</entry>
<entry>DOMDocumentType</entry>
<entry>yes</entry>
<entry>
The Document Type Declaration associated with this document.
</entry>
</row>
<row>
<entry>documentElement</entry>
<entry>DOMElement</entry>
<entry>yes</entry>
<entry>
This is a convenience attribute that allows direct access to the
child node that is the document element of the document.
</entry>
</row>
<row>
<entry>documentURI</entry>
<entry>string</entry>
<entry>no</entry>
<entry>
The location of the document or &null; if undefined.
</entry>
</row>
<row>
<entry>encoding</entry>
<entry>string</entry>
<entry>no</entry>
<entry></entry>
</row>
<row>
<entry>formatOutput</entry>
<entry>bool</entry>
<entry>no</entry>
<entry></entry>
</row>
<row>
<entry>implementation</entry>
<entry>DOMImplementation</entry>
<entry>yes</entry>
<entry>
The <classname>DOMImplementation</classname> object that handles
this document.
</entry>
</row>
<row>
<entry>preserveWhiteSpace</entry>
<entry>bool</entry>
<entry>no</entry>
<entry>Do not remove redundant white space. Default to &true;.</entry>
</row>
<row>
<entry>recover</entry>
<entry>bool</entry>
<entry>no</entry>
<entry></entry>
</row>
<row>
<entry>resolveExternals</entry>
<entry>bool</entry>
<entry>no</entry>
<entry>
Set it to &true; to load external entities from a doctype
declaration. This is useful for including character entities in
your XML document.
</entry>
</row>
<row>
<entry>standalone</entry>
<entry>bool</entry>
<entry>no</entry>
<entry></entry>
</row>
<row>
<entry>strictErrorChecking</entry>
<entry>bool</entry>
<entry>no</entry>
<entry>Throws DOMException on errors. Default to &true;.</entry>
</row>
<row>
<entry>substituteEntities</entry>
<entry>bool</entry>
<entry>no</entry>
<entry></entry>
</row>
<row>
<entry>validateOnParse</entry>
<entry>bool</entry>
<entry>no</entry>
<entry>Loads and validates against the DTD. Default to &false;.</entry>
</row>
<row>
<entry>version</entry>
<entry>string</entry>
<entry>no</entry>
<entry></entry>
</row>
<row>
<entry>xmlEncoding</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>
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.
</entry>
</row>
<row>
<entry>xmlStandalone</entry>
<entry>bool</entry>
<entry>no</entry>
<entry>
An attribute specifying, as part of the XML declaration, whether
this document is standalone. This is &false; when unspecified.
</entry>
</row>
<row>
<entry>xmlVersion</entry>
<entry>string</entry>
<entry>no</entry>
<entry>
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".
</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id='dom.class.domdocumentfragment'>
<title><classname>DOMDocumentFragment</classname></title>
<para>
Extends <classname>DOMNode</classname>.
</para>
<section xml:id='dom.class.domdocumentfragment.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domdocumentfragment-appendxml' /> - Append raw XML data (not DOM standard)</para>
</listitem>
</itemizedlist>
</section>
</section>
<section xml:id='dom.class.domdocumenttype'>
<title><classname>DOMDocumentType</classname></title>
<para>
Extends <classname>DOMNode</classname>
</para>
<para>
Each <classname>DOMDocument</classname> has a
<literal>doctype</literal> attribute whose value is either &null; or a
<classname>DOMDocumentType</classname> object.
</para>
<section xml:id='dom.class.domdocumenttype.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>publicId</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>The public identifier of the external subset.</entry>
</row>
<row>
<entry>systemId</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>The system identifier of the external subset. This may be an
absolute URI or not.</entry>
</row>
<row>
<entry>name</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>The name of DTD; i.e., the name immediately following the
<literal>DOCTYPE</literal> keyword.</entry>
</row>
<row>
<entry>entities</entry>
<entry>DOMNamedNodeMap</entry>
<entry>yes</entry>
<entry>
A <classname>DOMNamedNodeMap</classname> containing the general
entities, both external and internal, declared in the DTD.
</entry>
</row>
<row>
<entry>notations</entry>
<entry>DOMNamedNodeMap</entry>
<entry>yes</entry>
<entry>
A <classname>DOMNamedNodeMap</classname> containing the notations
declared in the DTD.
</entry>
</row>
<row>
<entry>internalSubset</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>
The internal subset as a string, or null if there is none. This is
does not contain the delimiting square brackets.
</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id='dom.class.domelement'>
<title><classname>DOMElement</classname></title>
<para>
Extends <classname>DOMNode</classname>.
</para>
<section xml:id='dom.class.domelement.constructor'>
&reftitle.constructor;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domelement-construct' /> - construct a new DOMElement object</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domelement.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domelement-getattribute' /> - Returns value of attribute</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-getattributenode' /> - Returns attribute node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-getattributenodens' /> - Returns attribute node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-getattributens' /> - Returns value of attribute</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-getelementsbytagname' /> - Gets elements by tagname</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-getelementsbytagnamens' /> - Get elements by namespaceURI and localName</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-hasattribute' /> - Checks to see if attribute exists</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-hasattributens' /> - Checks to see if attribute exists</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-removeattribute' /> - Removes attribute</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-removeattributenode' /> - Removes attribute</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-removeattributens' /> - Removes attribute</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-setattribute' /> - Adds new attribute</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-setattributenode' /> - Adds new attribute node to element</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-setattributenodens' /> - Adds new attribute node to element</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-setattributens' /> - Adds new attribute</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-setidattribute' /> - Declares the ID attribute</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-setidattributenode' /> - Declares the ID attribute</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domelement-setidattributens' /> - Declares the ID attribute</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domelement.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>schemaTypeInfo</entry>
<entry>bool</entry>
<entry>yes</entry>
<entry>Not implemented yet, always return &null;</entry>
</row>
<row>
<entry>tagName</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>The element name</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id='dom.class.domentity'>
<title><classname>DOMEntity</classname></title>
<para>
Extends <classname>DOMNode</classname>
</para>
<para>
This interface represents a known entity, either parsed or unparsed, in
an XML document.
</para>
<section xml:id='dom.class.domentity.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>publicId</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>
The public identifier associated with the entity if specified, and
&null; otherwise.
</entry>
</row>
<row>
<entry>systemId</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>
The system identifier associated with the entity if specified, and
&null; otherwise. This may be an absolute URI or not.
</entry>
</row>
<row>
<entry>notationName</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>
For unparsed entities, the name of the notation for the entity. For
parsed entities, this is &null;.
</entry>
</row>
<row>
<entry>actualEncoding</entry>
<entry>string</entry>
<entry>no</entry>
<entry>
An attribute specifying the encoding used for this entity at the
time of parsing, when it is an external parsed entity. This is
&null; if it an entity from the internal subset or if it is not
known.
</entry>
</row>
<row>
<entry>encoding</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>
An attribute specifying, as part of the text declaration, the
encoding of this entity, when it is an external parsed entity. This
is &null; otherwise.
</entry>
</row>
<row>
<entry>version</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>
An attribute specifying, as part of the text declaration, the
version number of this entity, when it is an external parsed
entity. This is &null; otherwise.
</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id='dom.class.domentityreference'>
<title><classname>DOMEntityReference</classname></title>
<para>
Extends <classname>DOMNode</classname>.
</para>
<section xml:id='dom.class.domentityreference.constructor'>
&reftitle.constructor;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domentityreference-construct' /> - construct a new DOMEntityReference object</para>
</listitem>
</itemizedlist>
</section>
</section>
<section xml:id='dom.class.domexception'>
<title><classname>DOMException</classname></title>
<para>
DOM operations raise exceptions under particular circumstances, i.e.,
when an operation is impossible to perform for logical reasons.
</para>
<para>
See also <xref linkend="language.exceptions"/>.
</para>
<section xml:id='dom.class.domexception.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>code</entry>
<entry>int</entry>
<entry>yes</entry>
<entry>An integer indicating the type of error generated</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id='dom.class.domimplementation'>
<title><classname>DOMImplementation</classname></title>
<para>
The <classname>DOMImplementation</classname> interface provides a number
of methods for performing operations that are independent of any
particular instance of the document object model.
</para>
<section xml:id='dom.class.domimplementation.constructor'>
&reftitle.constructor;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domimplementation-construct' /> - construct a new DOMImplementation object</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domimplementation.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domimplementation-createdocument' /> - Creates a DOM Document object of the specified type with its document element</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domimplementation-createdocumenttype' /> - Creates an empty DOMDocumentType object</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domimplementation-hasfeature' /> - Test if the DOM implementation implements a specific feature</para>
</listitem>
</itemizedlist>
</section>
</section>
<section xml:id='dom.class.domnamednodemap'>
<title><classname>DOMNamedNodeMap</classname></title>
<section xml:id='dom.class.domnamednodemap.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domnamednodemap-getnameditem' /> - Retrieves a node specified by name</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnamednodemap-getnameditemns' /> - Retrieves a node specified by local name and namespace URI</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnamednodemap-item' /> - Retrieves a node specified by index</para>
</listitem>
</itemizedlist>
</section>
</section>
<!-- <section xml:id='dom.class.domnamelist'>
<title><classname>DOMNameList</classname></title>
<para>
</para>
<section xml:id='dom.class.domnamelist.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domnamelist-getname' /> - </para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnamelist-getnamespaceuri' /> - </para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domnamelist.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>length</entry>
<entry>int</entry>
<entry>yes</entry>
<entry>
The number of pairs (name and namespaceURI) in the list. The range
of valid child node indices is 0 to <literal>length - 1</literal>
inclusive.
</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>-->
<section xml:id='dom.class.domnode'>
<title><classname>DOMNode</classname></title>
<section xml:id='dom.class.domnode.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domnode-appendchild' /> - Adds new child at the end of the children</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnode-clonenode' /> - Clones a node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnode-hasattributes' /> - Checks if node has attributes</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnode-haschildnodes' /> - Checks if node has children</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnode-insertbefore' /> - Adds a
new child before a reference node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnode-isdefaultnamespace' /> - Checks if the specified namespaceURI is
the default namespace</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnode-issamenode' /> - Indicates if two nodes are the same node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnode-issupported' /> - Checks if feature is supported for specified version</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnode-lookupnamespaceuri' /> - Returns namespace URI of the node based on the prefix</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnode-lookupprefix' /> - Returns name space prefix of the node based on namespaceURI</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnode-normalize' /> - Normalizes the node</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnode-removechild' /> - Removes child from list of children</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domnode-replacechild' /> - Replaces a child</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domnode.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>nodeName</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>Returns the most accurate name for the current node type</entry>
</row>
<row>
<entry>nodeValue</entry>
<entry>string</entry>
<entry>no</entry>
<entry>The value of this node, depending on its type.</entry>
</row>
<row>
<entry>nodeType</entry>
<entry>int</entry>
<entry>yes</entry>
<entry>Gets the type of the node. One of the predefined XML_xxx_NODE constants</entry>
</row>
<row>
<entry>parentNode</entry>
<entry>DOMNode</entry>
<entry>yes</entry>
<entry>The parent of this node.</entry>
</row>
<row>
<entry>childNodes</entry>
<entry>DOMNodeList</entry>
<entry>yes</entry>
<entry>
A <classname>DOMNodeList</classname> that contains all children of
this node. If there are no children, this is an empty
<classname>DOMNodeList</classname>.
</entry>
</row>
<row>
<entry>firstChild</entry>
<entry>DOMNode</entry>
<entry>yes</entry>
<entry>
The first child of this node. If there is no such node, this
returns &null;.
</entry>
</row>
<row>
<entry>lastChild</entry>
<entry>DOMNode</entry>
<entry>yes</entry>
<entry>
The last child of this node. If there is no such node, this returns
&null;.
</entry>
</row>
<row>
<entry>previousSibling</entry>
<entry>DOMNode</entry>
<entry>yes</entry>
<entry>
The node immediately preceding this node. If there is no such node,
this returns &null;.
</entry>
</row>
<row>
<entry>nextSibling</entry>
<entry>DOMNode</entry>
<entry>yes</entry>
<entry>
The node immediately following this node. If there is no such node,
this returns &null;.
</entry>
</row>
<row>
<entry>attributes</entry>
<entry>DOMNamedNodeMap</entry>
<entry>yes</entry>
<entry>
A <classname>DOMNamedNodeMap</classname> containing the attributes
of this node (if it is a <classname>DOMElement</classname>) or
&null; otherwise.
</entry>
</row>
<row>
<entry>ownerDocument</entry>
<entry>DOMDocument</entry>
<entry>yes</entry>
<entry>
The <classname>DOMDocument</classname> object associated with this
node.
</entry>
</row>
<row>
<entry>namespaceURI</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>
The namespace URI of this node, or &null; if it is unspecified.
</entry>
</row>
<row>
<entry>prefix</entry>
<entry>string</entry>
<entry>no</entry>
<entry>
The namespace prefix of this node, or &null; if it is unspecified.
</entry>
</row>
<row>
<entry>localName</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>
Returns the local part of the qualified name of this node.
</entry>
</row>
<row>
<entry>baseURI</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>
The absolute base URI of this node or &null; if the implementation
wasn't able to obtain an absolute URI.
</entry>
</row>
<row>
<entry>textContent</entry>
<entry>string</entry>
<entry>no</entry>
<entry>
This attribute returns the text content of this node and its
descendants.
</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id='dom.class.domnodelist'>
<title><classname>DOMNodeList</classname></title>
<para>
</para>
<section xml:id='dom.class.domnodelist.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domnodelist-item' /> - Retrieves a node specified by index</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domnodelist.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>length</entry>
<entry>int</entry>
<entry>yes</entry>
<entry>
The number of nodes in the list. The range of valid child node
indices is 0 to <literal>length - 1</literal> inclusive.
</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id='dom.class.domnotation'>
<title><classname>DOMNotation</classname></title>
<para>
Extends <classname>DOMNode</classname>
</para>
<section xml:id='dom.class.domnotation.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>publicId</entry>
<entry>string</entry>
<entry>yes</entry>
<entry></entry>
</row>
<row>
<entry>systemId</entry>
<entry>string</entry>
<entry>yes</entry>
<entry></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id='dom.class.domprocessinginstruction'>
<title><classname>DOMProcessingInstruction</classname></title>
<para>
Extends <classname>DOMNode</classname>.
</para>
<section xml:id='dom.class.domprocessinginstruction.constructor'>
&reftitle.constructor;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domprocessinginstruction-construct' /> - construct a new DOMProcessingInstruction object</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domprocessinginstruction.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>target</entry>
<entry>string</entry>
<entry>yes</entry>
<entry></entry>
</row>
<row>
<entry>data</entry>
<entry>string</entry>
<entry>no</entry>
<entry></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id='dom.class.domtext'>
<title><classname>DOMText</classname></title>
<para>
Extends <classname>DOMCharacterData</classname>.
</para>
<section xml:id='dom.class.domtext.constructor'>
&reftitle.constructor;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domtext-construct' /> - construct a new DOMText object</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domtext.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domtext-iswhitespaceinelementcontent' /> - Indicates whether this text node contains whitespace</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domtext-splittext' /> - Breaks the node into two nodes at the specified offset</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domtext.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>wholeText</entry>
<entry>string</entry>
<entry>yes</entry>
<entry></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section xml:id='dom.class.domxpath'>
<title><classname>DOMXPath</classname></title>
<para>
</para>
<section xml:id='dom.class.domxpath.constructor'>
&reftitle.constructor;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domxpath-construct' /> - construct a new DOMXPath object</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domxpath.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><xref linkend='function.dom-domxpath-registernamespace' /> - Registers the namespace with the DOMXpath object</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domxpath-evaluate' /> - Evaluates the given XPath expression and returns a typed result if possible</para>
</listitem>
<listitem>
<para><xref linkend='function.dom-domxpath-query' /> - Evaluates the given XPath expression</para>
</listitem>
</itemizedlist>
</section>
<section xml:id='dom.class.domxpath.properties'>
&reftitle.properties;
<table>
<title/>
<tgroup cols="4">
<thead>
<row>
<entry>Name</entry>
<entry>Type</entry>
<entry>Read-only</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>document</entry>
<entry>DOMDocument</entry>
<entry></entry>
<entry></entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
</section>
<section xml:id="dom.examples">
&reftitle.examples;
<para>
Many examples in this reference require an XML file. We will use
<filename>book.xml</filename> that contains the following:
</para>
<para>
<example>
<title>book.xml</title>
<programlisting role="xml">
<![CDATA[
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
]>
<book id="listing">
<title>My lists</title>
<chapter id="books">
<title>My books</title>
<para>
<informaltable>
<tgroup cols="4">
<thead>
<row>
<entry>Title</entry>
<entry>Author</entry>
<entry>Language</entry>
<entry>ISBN</entry>
</row>
</thead>
<tbody>
<row>
<entry>The Grapes of Wrath</entry>
<entry>John Steinbeck</entry>
<entry>en</entry>
<entry>0140186409</entry>
</row>
<row>
<entry>The Pearl</entry>
<entry>John Steinbeck</entry>
<entry>en</entry>
<entry>014017737X</entry>
</row>
<row>
<entry>Samarcande</entry>
<entry>Amine Maalouf</entry>
<entry>fr</entry>
<entry>2253051209</entry>
</row>
<!-- TODO: I have a lot of remaining books to add.. -->
</tbody>
</tgroup>
</informaltable>
</para>
</chapter>
</book>
]]>
</programlisting>
</example>
</para>
</section>
&reference.dom.constants;
</partintro>
&reference.dom.entities.functions;
</reference>
<!-- 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:"../../../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
-->