From b960a93a95fb6186fedbf473ed74a34a180d45f1 Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Fri, 17 Dec 2004 16:15:37 +0000 Subject: [PATCH] Rewrote the DOM reference page and detailed every class methods and props There's still a lot to do here, but at least there's a bunch of new information, feel free to fill in the blanks git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@174994 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../functions/dom-domdocument-construct.xml | 45 + .../dom/functions/dom-domstringlist-item.xml | 45 + .../dom/functions/dom-domxpath-evaluate.xml | 44 + .../dom/functions/dom-domxpath-query.xml | 4 +- reference/dom/reference.xml | 1141 +++++++++++++++-- 5 files changed, 1173 insertions(+), 106 deletions(-) create mode 100644 reference/dom/functions/dom-domdocument-construct.xml create mode 100644 reference/dom/functions/dom-domstringlist-item.xml create mode 100644 reference/dom/functions/dom-domxpath-evaluate.xml diff --git a/reference/dom/functions/dom-domdocument-construct.xml b/reference/dom/functions/dom-domdocument-construct.xml new file mode 100644 index 0000000000..3a97421ea9 --- /dev/null +++ b/reference/dom/functions/dom-domdocument-construct.xml @@ -0,0 +1,45 @@ + + + + + DOMDocument->__construct + + Creates a new DOMDocument object + + + + &reftitle.description; + + DOMDocument + + __construct + stringversion + stringencoding + + + + Creates a new DOMDocument object. + + + + + diff --git a/reference/dom/functions/dom-domstringlist-item.xml b/reference/dom/functions/dom-domstringlist-item.xml new file mode 100644 index 0000000000..61182569bc --- /dev/null +++ b/reference/dom/functions/dom-domstringlist-item.xml @@ -0,0 +1,45 @@ + + + + + DOMStringList->item + + Return the specified index of the collection + + + + &reftitle.description; + + DOMStringList + + DOMString + item + intindex + + + + Not implemented yet. + + + + + diff --git a/reference/dom/functions/dom-domxpath-evaluate.xml b/reference/dom/functions/dom-domxpath-evaluate.xml new file mode 100644 index 0000000000..b183193959 --- /dev/null +++ b/reference/dom/functions/dom-domxpath-evaluate.xml @@ -0,0 +1,44 @@ + + + + + DOMXPath->evaluate + + Evaluates the given XPath expression and returns a typed result + + + + &reftitle.description; + + DOMXPath + + mixed + evaluate + stringexpression + DOMNodecontextnode + + + &warn.undocumented.func; + + + + diff --git a/reference/dom/functions/dom-domxpath-query.xml b/reference/dom/functions/dom-domxpath-query.xml index f942f89921..9bc11e6610 100644 --- a/reference/dom/functions/dom-domxpath-query.xml +++ b/reference/dom/functions/dom-domxpath-query.xml @@ -1,10 +1,10 @@ - + DOMXPath->query - Evaluates the XPath expression in the given string + Evaluates the given XPath expression diff --git a/reference/dom/reference.xml b/reference/dom/reference.xml index 56189220f8..6d4e9e146a 100644 --- a/reference/dom/reference.xml +++ b/reference/dom/reference.xml @@ -1,5 +1,5 @@ - + DOM Functions DOM @@ -19,120 +19,1053 @@ - &reference.dom.constants; - -
- Classes +
+ &reftitle.classes; - The API of the module follows the DOM Level 2 standard as closely + The API of the module follows the DOM Level 2 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. - This module defines a number of classes, which are listed - - including their - method - in the following tables. Classes with an equivalent in the - DOM standard are named DOMxxx. + 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. - - - - List of classes - - - - Class name - Parent classes - - - - - DOMAttr - DOMNode - - - DOMCDataSection - DOMText - - - DOMCharacterData - DOMNode - - - DOMComment - DOMCharacterData - - - DOMDocument - DOMNode - - - DOMDocumentFragment - DOMNode - - - DOMDocumentType - DOMNode - - - DOMElement - DOMNode - - - DOMEntity - DOMNode - - - DOMEntityReference - DOMNode - - - DOMNode - - - - DOMNotation - DOMNode - - - DOMProcessingInstruction - DOMNode - - - DOMText - DOMCharacterData - - - DOMException - - - - DOMImplementation - - - - DOMNamedNodeMap - - - - DOMNodeList - - - - DOMXPath - - - - -
-
-
+
+ <classname>DOMAttr</classname> + + Extends DOMNode. + +
+ &reftitle.methods; + + + isId - Checks if attribute is a defined ID + + +
+
+ &reftitle.properties; + + + <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> + + Extends DOMNode. + +
+ &reftitle.methods; + + + appendData - Append a string to the end of the character data of the node + + + deleteData - Remove a range of characters from the node + + + insertData - Insert a string at the specified 16-bit unit offset + + + replaceData - Replace a substring within the DOMCharacterData node + + + substringData - Extracts a range of data from the node + + +
+
+ &reftitle.properties; +
+ + <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> + + Extends DOMNode. + +
+ &reftitle.constructor; + + + __construct - construct a new DOMDocument object + + +
+
+ &reftitle.methods; + + + createAttribute - Create new attribute + + + createAttributeNS - Create new attribute node with an associated namespace + + + createCDATASection - Create new cdata node + + + createComment - Create new comment node + + + createDocumentFragment - Create new document fragment + + + createElement - Create new element node + + + createElementNS - Create new element node with an associated namespace + + + createEntityReference - Create new entity reference node + + + createProcessingInstruction - Creates new PI node + + + createTextNode - Create new text node + + + getElementById - Searches for an element with a certain id + + + getElementsByTagName - Searches for all elements with given tag name + + + getElementsByTagNameNS - Searches for all elements with given tag name in specified namespace + + + importNode - Import node into current document + + + load - Load XML from a file + + + loadHTML - Load HTML from a string + + + loadHTMLFile - Load HTML from a file + + + loadXML - Load XML from a string + + + normalize - Normalizes document + + + relaxNGValidate - Performs relaxNG validation on the document + + + relaxNGValidateSource - Performs relaxNG validation on the document + + + save - Dumps the internal XML tree back into a file + + + saveHTML - Dumps the internal document into a string using HTML formatting + + + saveHTMLFile - Dumps the internal document back into a file using HTML formatting + + + saveXML - Dumps the internal XML tree back into a string + + + schemaValidate - Validates a document based on a schema + + + schemaValidateSource - Validates a document based on a schema + + + validate - Validates the document based on its DTD + + + xinclude - Substitutes XIncludes in a DOMDocument Object + + +
+
+ &reftitle.properties; +
+ + <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></entry> + </row> + <row> + <entry>documentElement</entry> + <entry>DOMElement</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>documentURI</entry> + <entry>string</entry> + <entry>no</entry> + <entry></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></entry> + </row> + <row> + <entry>preserveWhiteSpace</entry> + <entry>bool</entry> + <entry>no</entry> + <entry></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></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></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></entry> + </row> + <row> + <entry>xmlStandalone</entry> + <entry>bool</entry> + <entry>no</entry> + <entry></entry> + </row> + <row> + <entry>xmlVersion</entry> + <entry>string</entry> + <entry>no</entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </section> + </section> + + <section id='dom.class.domdocumenttype'> + <title><classname>DOMDocumentType</classname> + + Extends DOMNode + +
+ &reftitle.properties; +
+ + <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> + <row> + <entry>name</entry> + <entry>string</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>entities</entry> + <entry>DOMNamedNodeMap</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>notations</entry> + <entry>DOMNamedNodeMap</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>internalSubset</entry> + <entry>string</entry> + <entry>yes</entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </section> + </section> + + <section id='dom.class.domelement'> + <title><classname>DOMElement</classname> + + Extends DOMNode. + +
+ &reftitle.methods; + + + getAttribute - Returns value of attribute + + + getAttributeNode - Returns attribute node + + + getAttributeNodeNS - Returns attribute node + + + getAttributeNS - Returns value of attribute + + + getElementsByTagName - Gets elements by tagname + + + getElementsByTagNameNS - Get elements by namespaceURI and localName + + + hasAttribute - Checks to see if attribute exists + + + hasAttributeNS - Checks to see if attribute exists + + + removeAttribute - Removes attribute + + + removeAttributeNode - Removes attribute + + + removeAttributeNS - Removes attribute + + + setAttribute - Adds new attribute + + + setAttributeNode - Adds new attribute node to element + + + setAttributeNodeNS - Adds new attribute node to element + + + setAttributeNS - Adds new attribute + + +
+
+ &reftitle.properties; +
+ + <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> + + Extends DOMNode + +
+ &reftitle.properties; +
+ + <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> + <row> + <entry>notationName</entry> + <entry>string</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>actualEncoding</entry> + <entry>string</entry> + <entry>no</entry> + <entry></entry> + </row> + <row> + <entry>encoding</entry> + <entry>string</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>version</entry> + <entry>string</entry> + <entry>no</entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </section> + </section> + + <section id='dom.class.domentityreference'> + <title><classname>DOMEntityReference</classname> + + Extends DOMNode. + + + +
+ <classname>DOMException</classname> + + DOM operations raise exceptions under perticular circumstances, i.e., + when an operation is impossible to perform for logical reasons. + + + See also . + +
+ &reftitle.properties; +
+ + <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.domnamelist'> + <title><classname>DOMNameList</classname> + + + +
+ &reftitle.methods; + + + getName - + + + getNamespaceURI - + + +
+
+ &reftitle.properties; +
+ + <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></entry> + </row> + </tbody> + </tgroup> + </table> + </section> + </section> + + + <section id='dom.class.domnode'> + <title><classname>DOMNode</classname> +
+ &reftitle.methods; + + + appendChild - Adds new child at the end of the children + + + cloneNode - Clones a node + + + hasAttributes - Checks if node has attributes + + + hasChildNodes - Checks if node has children + + + insertBefore - Adds new child at the end of the children + + + isSameNode - Indicates if two nodes are the same node + + + isSupported - Checks if feature is supported for specified version + + + lookupNamespaceURI - Returns namespace URI of the node based on the prefix + + + lookupPrefix - Returns name space prefix of the node based on namespaceURI + + + normalize - Normalizes the node + + + removeChild - Removes child from list of children + + + replaceChild - Replaces a child + + +
+
+ &reftitle.properties; +
+ + <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></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></entry> + </row> + <row> + <entry>childNodes</entry> + <entry>DOMNodeList</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>firstChild</entry> + <entry>DOMNode</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>lastChild</entry> + <entry>DOMNode</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>previousSibling</entry> + <entry>DOMNode</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>nextSibling</entry> + <entry>DOMNode</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>attributes</entry> + <entry>DomNamedNodeMap</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>ownerDocument</entry> + <entry>DOMDocument</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>namespaceURI</entry> + <entry>string</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>prefix</entry> + <entry>string</entry> + <entry>no</entry> + <entry></entry> + </row> + <row> + <entry>localName</entry> + <entry>string</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>baseURI</entry> + <entry>string</entry> + <entry>yes</entry> + <entry></entry> + </row> + <row> + <entry>textContent</entry> + <entry>string</entry> + <entry>no</entry> + <entry></entry> + </row> + </tbody> + </tgroup> + </table> + </section> + </section> + + <section id='dom.class.domnotation'> + <title><classname>DOMNotation</classname> + + Extends DOMNode + +
+ &reftitle.properties; +
+ + <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> + + Extends DOMNode. + +
+ &reftitle.properties; +
+ + <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> + + + +
+ &reftitle.methods; + + + item - Return the specified index of the collection + + +
+
+ &reftitle.properties; +
+ + <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> + + + +
+ &reftitle.methods; + + + isElementContentWhitespace - + + + isWhitespaceInElementContent - + + + replaceWholeText - + + + splitText - + + +
+
+ &reftitle.properties; +
+ + <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> + + +
+ &reftitle.methods; + + + registerNamespace - Registers the namespace with the DOMXpath object + + + evaluate - Evaluates the given XPath expression and returns a typed result + + + query - Evaluates the given XPath expression + + +
+
+ &reftitle.properties; +
+ + <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> + + &reference.dom.constants; + </partintro> &reference.dom.functions; - </reference> <!-- Keep this comment at the end of the file Local variables: