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

1287 lines
42 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<reference id="ref.dom">
<title>DOM Functions</title>
<titleabbrev>DOM</titleabbrev>
<partintro>
<section id="dom.intro">
&reftitle.intro;
<para>
The DOM extension is the replacement for the
<link linkend="ref.domxml">DOM XML</link> extension from PHP 4.
The extension still contains many old functions, but they should no
longer be used. In particular, functions that are not object-oriented
should be avoided.
</para>
<para>
The extension allows you to operate on an XML document with the DOM API.
</para>
</section>
<section id='dom.classes'>
&reftitle.classes;
<para>
The API of the module follows the <ulink
url="&url.dom2.spec;">DOM Level 2</ulink> 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 id='dom.class.domattr'>
<title><classname>DOMAttr</classname></title>
<para>
Extends <classname>DOMNode</classname>.
</para>
<section id='dom.class.domattr.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><link linkend='function.dom-domattr-isid'>isId</link> - Checks if attribute is a defined ID</para>
</listitem>
</itemizedlist>
</section>
<section 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 &true;</entry>
</row>
<row>
<entry>specified</entry>
<entry>bool</entry>
<entry>yes</entry>
<entry>Not implemented yet, always return &true;</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 id='dom.class.domcharacterdata'>
<title><classname>DOMCharacterData</classname></title>
<para>
Extends <classname>DOMNode</classname>.
</para>
<section id='dom.class.domcharacterdata.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><link linkend='function.dom-domcharacterdata-appenddata'>appendData</link> - Append a string to the end of the character data of the node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domcharacterdata-deletedata'>deleteData</link> - Remove a range of characters from the node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domcharacterdata-insertdata'>insertData</link> - Insert a string at the specified 16-bit unit offset</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domcharacterdata-replacedata'>replaceData</link> - Replace a substring within the DOMCharacterData node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domcharacterdata-substringdata'>substringData</link> - Extracts a range of data from the node</para>
</listitem>
</itemizedlist>
</section>
<section 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 id='dom.class.domdocument'>
<title><classname>DOMDocument</classname></title>
<para>
Extends <classname>DOMNode</classname>.
</para>
<section id='dom.class.domdocument.constructor'>
&reftitle.constructor;
<itemizedlist>
<listitem>
<para><link linkend='function.dom-domdocument-construct'>__construct</link> - construct a new DOMDocument object</para>
</listitem>
</itemizedlist>
</section>
<section id='dom.class.domdocument.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><link linkend='function.dom-domdocument-createattribute'>createAttribute</link> - Create new attribute</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-createattributens'>createAttributeNS</link> - Create new attribute node with an associated namespace</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-createcdatasection'>createCDATASection</link> - Create new cdata node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-createcomment'>createComment</link> - Create new comment node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-createdocumentfragment'>createDocumentFragment</link> - Create new document fragment</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-createelement'>createElement</link> - Create new element node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-createelementns'>createElementNS</link> - Create new element node with an associated namespace</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-createentityreference'>createEntityReference</link> - Create new entity reference node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-createprocessinginstruction'>createProcessingInstruction</link> - Creates new PI node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-createtextnode'>createTextNode</link> - Create new text node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-getelementbyid'>getElementById</link> - Searches for an element with a certain id</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-getelementsbytagname'>getElementsByTagName</link> - Searches for all elements with given tag name</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-getelementsbytagnamens'>getElementsByTagNameNS</link> - Searches for all elements with given tag name in specified namespace</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-importnode'>importNode</link> - Import node into current document</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-load'>load</link> - Load XML from a file</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-loadhtml'>loadHTML</link> - Load HTML from a string</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-loadxmlfile'>loadHTMLFile</link> - Load HTML from a file</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-loadxml'>loadXML</link> - Load XML from a string</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-normalize'>normalize</link> - Normalizes document</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-relaxngvalidate'>relaxNGValidate</link> - Performs relaxNG validation on the document</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-relaxngvalidatesource'>relaxNGValidateSource</link> - Performs relaxNG validation on the document</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-save'>save</link> - Dumps the internal XML tree back into a file</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-savehtml'>saveHTML</link> - Dumps the internal document into a string using HTML formatting</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-savehtmlfile'>saveHTMLFile</link> - Dumps the internal document back into a file using HTML formatting</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-savexml'>saveXML</link> - Dumps the internal XML tree back into a string</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-schemavalidate'>schemaValidate</link> - Validates a document based on a schema</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-schemavalidatesource'>schemaValidateSource</link> - Validates a document based on a schema</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-validate'>validate</link> - Validates the document based on its DTD</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domdocument-xinclude'>xinclude</link> - Substitutes XIncludes in a DOMDocument Object</para>
</listitem>
</itemizedlist>
</section>
<section 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 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 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 id='dom.class.domelement'>
<title><classname>DOMElement</classname></title>
<para>
Extends <classname>DOMNode</classname>.
</para>
<section id='dom.class.domelement.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><link linkend='function.dom-domelement-getattribute'>getAttribute</link> - Returns value of attribute</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-getattributenode'>getAttributeNode</link> - Returns attribute node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-getattributenodens'>getAttributeNodeNS</link> - Returns attribute node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-getattributens'>getAttributeNS</link> - Returns value of attribute</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-getelementsbytagname'>getElementsByTagName</link> - Gets elements by tagname</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-getelementsbytagnamens'>getElementsByTagNameNS</link> - Get elements by namespaceURI and localName</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-hasattribute'>hasAttribute</link> - Checks to see if attribute exists</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-hasattributens'>hasAttributeNS</link> - Checks to see if attribute exists</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-removeattribute'>removeAttribute</link> - Removes attribute</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-removeattributenode'>removeAttributeNode</link> - Removes attribute</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-removeattributens'>removeAttributeNS</link> - Removes attribute</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-setattribute'>setAttribute</link> - Adds new attribute</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-setattributenode'>setAttributeNode</link> - Adds new attribute node to element</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-setattributenodens'>setAttributeNodeNS</link> - Adds new attribute node to element</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domelement-setattributens'>setAttributeNS</link> - Adds new attribute</para>
</listitem>
</itemizedlist>
</section>
<section 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 &true;</entry>
</row>
<row>
<entry>tagName</entry>
<entry>string</entry>
<entry>yes</entry>
<entry>The element name</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section 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 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 id='dom.class.domentityreference'>
<title><classname>DOMEntityReference</classname></title>
<para>
Extends <classname>DOMNode</classname>.
</para>
</section>
<section id='dom.class.domexception'>
<title><classname>DOMException</classname></title>
<para>
DOM operations raise exceptions under perticular circumstances, i.e.,
when an operation is impossible to perform for logical reasons.
</para>
<para>
See also <xref linkend="language.oop5.exceptions"/>.
</para>
<section 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 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 id='dom.class.domimplementation.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><link linkend='function.dom-domimplementation-createdocument'>createDocument</link> - Creates a DOM Document object of the specified type with its document element</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domimplementation-createdocumenttype'>createDocumentType</link> - Creates an empty DOMDocumentType object</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domimplementation-hasfeature'>hasFeature</link> - Test if the DOM implementation implements a specific feature</para>
</listitem>
</itemizedlist>
</section>
</section>
<section id='dom.class.domnamelist'>
<title><classname>DOMNameList</classname></title>
<para>
</para>
<section id='dom.class.domnamelist.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><link linkend='function.dom-domnamelist-getname'>getName</link> - </para>
</listitem>
<listitem>
<para><link linkend='function.dom-domnamelist-getnamespaceuri'>getNamespaceURI</link> - </para>
</listitem>
</itemizedlist>
</section>
<section 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 id='dom.class.domnode'>
<title><classname>DOMNode</classname></title>
<section id='dom.class.domnode.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><link linkend='function.dom-domnode-appendchild'>appendChild</link> - Adds new child at the end of the children</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domnode-clonenode'>cloneNode</link> - Clones a node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domnode-hasattributes'>hasAttributes</link> - Checks if node has attributes</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domnode-haschildnodes'>hasChildNodes</link> - Checks if node has children</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domnode-insertbefore'>insertBefore</link> - Adds new child at the end of the children</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domnode-issamenode'>isSameNode</link> - Indicates if two nodes are the same node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domnode-issupported'>isSupported</link> - Checks if feature is supported for specified version</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domnode-lookupnamespaceuri'>lookupNamespaceURI</link> - Returns namespace URI of the node based on the prefix</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domnode-lookupprefix'>lookupPrefix</link> - Returns name space prefix of the node based on namespaceURI</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domnode-normalize'>normalize</link> - Normalizes the node</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domnode-removechild'>removeChild</link> - Removes child from list of children</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domnode-replacechild'>replaceChild</link> - Replaces a child</para>
</listitem>
</itemizedlist>
</section>
<section 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 more 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 id='dom.class.domnotation'>
<title><classname>DOMNotation</classname></title>
<para>
Extends <classname>DOMNode</classname>
</para>
<section 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 id='dom.class.domprocessinginstruction'>
<title><classname>DOMProcessingInstruction</classname></title>
<para>
Extends <classname>DOMNode</classname>.
</para>
<section 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 id='dom.class.domstringlist'>
<title><classname>DOMStringList</classname></title>
<para>
</para>
<section id='dom.class.domstringlist.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><link linkend='function.dom-domstringlist-item'>item</link> - Return the specified index of the collection</para>
</listitem>
</itemizedlist>
</section>
<section id='dom.class.domstringlist.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 DOMStrings in the list. Not implemented yet, always return &true;.
</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
<section id='dom.class.domtext'>
<title><classname>DOMText</classname></title>
<para>
</para>
<section id='dom.class.domtext.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><link linkend='function.dom-domtext-iselementcontentwhitespace'>isElementContentWhitespace</link> - </para>
</listitem>
<listitem>
<para><link linkend='function.dom-domtext-isWhitespaceinelementcontent'>isWhitespaceInElementContent</link> - </para>
</listitem>
<listitem>
<para><link linkend='function.dom-domtext-replacewholetext'>replaceWholeText</link> - </para>
</listitem>
<listitem>
<para><link linkend='function.dom-domtext-splittext'>splitText</link> - </para>
</listitem>
</itemizedlist>
</section>
<section 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 id='dom.class.domxpath'>
<title><classname>DOMXPath</classname></title>
<para>
</para>
<section id='dom.class.domxpath.constructor'>
&reftitle.constructor;
<itemizedlist>
<listitem>
<para><link linkend='function.dom-domxpath-construct'>__construct</link> - construct a new DOMXPath object</para>
</listitem>
</itemizedlist>
</section>
<section id='dom.class.domxpath.methods'>
&reftitle.methods;
<itemizedlist>
<listitem>
<para><link linkend='function.dom-domxpath-registernamespace'>registerNamespace</link> - Registers the namespace with the DOMXpath object</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domxpath-evaluate'>evaluate</link> - Evaluates the given XPath expression and returns a typed result</para>
</listitem>
<listitem>
<para><link linkend='function.dom-domxpath-query'>query</link> - Evaluates the given XPath expression</para>
</listitem>
</itemizedlist>
</section>
<section 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 id="dom.examples">
&reftitle.examples;
<para>
Many examples in this reference require an XML file. We will use the
<filename>book.xml</filename> that contains the following:
</para>
<para>
<example>
<title>chapter.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.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
-->