diff --git a/reference/dom/functions/dom-domdocument-construct.xml b/reference/dom/functions/dom-domdocument-construct.xml index 3a59b3f272..f184476d6b 100644 --- a/reference/dom/functions/dom-domdocument-construct.xml +++ b/reference/dom/functions/dom-domdocument-construct.xml @@ -1,8 +1,8 @@ - + - DOMDocument->__construct + DOMDocument->__construct() Creates a new DOMDocument object @@ -67,7 +67,7 @@ echo $dom->saveXML(); /* */ &reftitle.seealso; - DOMImplementation-createDocument() + diff --git a/reference/dom/functions/dom-domdocument-getelementbyid.xml b/reference/dom/functions/dom-domdocument-getelementbyid.xml index 1cc7b6d9b0..fe270e1508 100644 --- a/reference/dom/functions/dom-domdocument-getelementbyid.xml +++ b/reference/dom/functions/dom-domdocument-getelementbyid.xml @@ -1,34 +1,59 @@ - - - - DOMDocument->getElementById - Searches for an element with a certain id - - - &reftitle.description; - - DOMDocument - - DOMElement - getElementById - stringelementId - - - - This function is similar to - DOMDocument->getElementsByTagName() - but searches for an element with a given id. - - - According to the DOM standard this requires a DTD which defines the - attribute ID to be of type ID. You need to validate your document with - DOMDocument->validate() - or DOMDocument::validateOnParse before using this function. - - - DOMDocument->getElementById() Example - + + + + DOMDocument->getElementById() + Searches for an element with a certain id + + + &reftitle.description; + + DOMDocument + + DOMElement + getElementById + stringelementId + + + + This function is similar to + but + searches for an element with a given id. + + + According to the DOM standard this requires a DTD which defines the + attribute ID to be of type ID. You need to validate your document with + + or DOMDocument->validateOnParse before using this function. + + + + &reftitle.parameters; + + + + elementId + + + The unique id value for an element. + + + + + + + + &reftitle.returnvalues; + + Returns the DOMElement or &null; if the element is + not found. + + + + &reftitle.examples; + + DOMDocument->getElementById() Example + getElementById('books')->tagNa ?> ]]> - - &example.outputs; - + + &example.outputs; + - - - - See also DOMDocument->getElementsByTagName(). - - - + + + + + &reftitle.seealso; + + + + + + + - - - DOMDocument->getElementsByTagName - Searches for all elements with given tag name - - - &reftitle.description; - - DOMDocument - - DOMNodeList - getElementsByTagName - stringname - - - - This function returns a new instance of class - DOMNodeList containing the elements with tagnames - matching the name parameter. Use "*" for the name to return all elements - within the document. - - - + + + + DOMDocument->getElementsByTagName() + Searches for all elements with given tag name + + + &reftitle.description; + + DOMDocument + + DOMNodeList + getElementsByTagName + stringname + + + + This function returns a new instance of class + DOMNodeList containing the elements with a given + tag name. + + + + &reftitle.parameters; + + + + name + + + The name of the tag to match on. The special value * + matches all tags. + + + + + + + + &reftitle.returnvalues; + + A new DOMNodeList object containing all the matched + elements. + + + + &reftitle.seealso; + + + + + + + - - - DOMDocument->importNode - Import node into current document - - - &reftitle.description; - - DOMDocument - - DOMNode - importNode - DOMNodeimportedNode - booldeep - - - - This function returns a copy of the node to import and associates it with - the current document. DOMException is thrown if - node cannot be imported. - - - If deep is set to &true;, this method will recursively - import the subtree under the importedNode. - - - + + + + DOMDocument->importNode() + Import node into current document + + + &reftitle.description; + + DOMDocument + + DOMNode + importNode + DOMNodeimportedNode + booldeep + + + + This function returns a copy of the node to import and associates it with + the current document. + + + + &reftitle.parameters; + + + + importedNode + + + The node to import. + + + + + deep + + + If set to &true;, this method will recursively import the subtree under + the importedNode. + + + + + + + + &reftitle.returnvalues; + + The copied node. + + + + &reftitle.exceptions; + + DOMException is thrown if node cannot be imported. + + + + - DOMDocument->load + DOMDocument->load() Load XML from a file @@ -12,7 +12,7 @@ DOMDocument - mixed + bool load stringfilename @@ -42,6 +42,12 @@ + + &reftitle.returnvalues; + + &return.success; + + &reftitle.examples; @@ -66,9 +72,9 @@ echo $doc->saveXML(); &reftitle.seealso; - DOMDocument->loadXML() - DOMDocument->save() - DOMDocument->saveXML() + + + diff --git a/reference/dom/functions/dom-domdocument-loadhtml.xml b/reference/dom/functions/dom-domdocument-loadhtml.xml index df158c39f3..74cc0e28fe 100644 --- a/reference/dom/functions/dom-domdocument-loadhtml.xml +++ b/reference/dom/functions/dom-domdocument-loadhtml.xml @@ -1,54 +1,83 @@ - - - - DOMDocument->loadHTML - - Load HTML from a string - - - - &reftitle.description; - - DOMDocument - - mixed - loadHTML - stringsource - - - - The function parses the HTML contained in the string source. - Unlike loading XML, HTML does not have to be well-formed to load. This - function may also be called statically to load and create a - DOMDocument object. The static invocation may be - used when no DOMDocument properties need to be - set prior to loading. - - - - Creating a Document - + + + + DOMDocument->loadHTML() + + Load HTML from a string + + + + &reftitle.description; + + DOMDocument + + bool + loadHTML + stringsource + + + + The function parses the HTML contained in the string source. + Unlike loading XML, HTML does not have to be well-formed to load. This + function may also be called statically to load and create a + DOMDocument object. The static invocation may be + used when no DOMDocument properties need to be + set prior to loading. + + + + &reftitle.parameters; + + + + source + + + The HTML string. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + + Creating a Document + Test
"); -print $doc->saveHTML(); +echo $doc->saveHTML(); $doc = new DOMDocument(); $doc->loadHTML("Test
"); -print $doc->saveHTML(); +echo $doc->saveHTML(); ?> ]]> -
-
-
- - See also DOMDocument->loadHTMLFile(), - DOMDocument->saveHTML() and - DOMDocument->saveHTMLFile(). - -
-
+
+
+
+
+ + &reftitle.seealso; + + + + + + + + +
- - - DOMDocument->loadHTMLFile - - Load HTML from a file - - - - &reftitle.description; - - DOMDocument - - mixed - loadHTMLFile - stringfilename - - - - The function parses the HTML document in the file named - filename. Unlike loading XML, HTML does not have - to be well-formed to load.This function may also be called statically to - load and create a DOMDocument object. The static - invocation may be used when no DOMDocument - properties need to be set prior to loading. - - - - Creating a Document - + + + + DOMDocument->loadHTMLFile() + + Load HTML from a file + + + + &reftitle.description; + + DOMDocument + + bool + loadHTMLFile + stringfilename + + + + The function parses the HTML document in the file named + filename. Unlike loading XML, HTML does not have + to be well-formed to load. + + + This function may also be called statically to load and create a + DOMDocument object. The static invocation may be + used when no DOMDocument properties need to be set + prior to loading. + + + + &reftitle.parameters; + + + + filename + + + The path to the HTML file. + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + &reftitle.examples; + + + Creating a Document + loadHTMLFile("filename.html"); print $doc->saveHTML(); ?> ]]> - - - - - See also DOMDocument->loadHTML(), - DOMDocument->saveHTML() and - DOMDocument->saveHTMLFile(). - - - + + + + + + &reftitle.seealso; + + + + + + + + + + - DOMDocument->loadXML + DOMDocument->loadXML() Load XML from a string @@ -12,7 +12,7 @@ DOMDocument - mixed + bool loadXML stringsource @@ -42,6 +42,12 @@ + + &reftitle.returnvalues; + + &return.success; + + &reftitle.examples; @@ -66,9 +72,9 @@ echo $doc->saveXML(); &reftitle.seealso; - DOMDocument->load() - DOMDocument->save() - DOMDocument->saveXML() + + + diff --git a/reference/dom/functions/dom-domdocument-normalize.xml b/reference/dom/functions/dom-domdocument-normalize.xml index c829222196..507882d354 100644 --- a/reference/dom/functions/dom-domdocument-normalize.xml +++ b/reference/dom/functions/dom-domdocument-normalize.xml @@ -1,27 +1,41 @@ - - - - DOMDocument->normalize - - Normalizes document - - - - &reftitle.description; - - DOMDocument - - void - normalize - - - - - Normalizes document. - - - + + + + DOMDocument->normalize() + + Normalizes the document + + + + &reftitle.description; + + DOMDocument + + + normalize + + + + + Normalizes the document. + + + + &reftitle.returnvalues; + + &return.void; + + + + &reftitle.seealso; + + + + + + + + - DOMDocument->save + DOMDocument->save() Dumps the internal XML tree back into a file @@ -77,9 +77,9 @@ echo 'Wrote: ' . $doc->save("/tmp/test.xml") . ' bytes'; // Wrote: 72 bytes &reftitle.seealso; - DOMDocument->saveXML() - DOMDocument->load() - DOMDocument->loadXML() + + + diff --git a/reference/dom/functions/dom-domdocument-savexml.xml b/reference/dom/functions/dom-domdocument-savexml.xml index 37797c207a..2c72d8b7a9 100644 --- a/reference/dom/functions/dom-domdocument-savexml.xml +++ b/reference/dom/functions/dom-domdocument-savexml.xml @@ -1,5 +1,5 @@ - + DOMDocument->saveXML() @@ -44,6 +44,13 @@ Returns the XML, or &false; if an error occured. + + &reftitle.exceptions; + + Throws DOMException if node + is from another document. + + &reftitle.examples; diff --git a/reference/dom/functions/dom-domdocument-validate.xml b/reference/dom/functions/dom-domdocument-validate.xml index a7ce7bec03..b921348e34 100644 --- a/reference/dom/functions/dom-domdocument-validate.xml +++ b/reference/dom/functions/dom-domdocument-validate.xml @@ -1,8 +1,8 @@ - + - DOMDocument->validate + DOMDocument->validate() Validates the document based on its DTD @@ -67,10 +67,10 @@ $dom->Load('book.xml'); &reftitle.seealso; - DOMDocument->schemaValidate() - DOMDocument->schemaValidateSource() - DOMDocument->relaxNGValidate() - DOMDocument->relaxNGValidateSource() + + + + diff --git a/reference/dom/functions/dom-domdocument-xinclude.xml b/reference/dom/functions/dom-domdocument-xinclude.xml index ade652a7d6..abbb439fca 100644 --- a/reference/dom/functions/dom-domdocument-xinclude.xml +++ b/reference/dom/functions/dom-domdocument-xinclude.xml @@ -1,8 +1,8 @@ - + - DOMDocument->xinclude + DOMDocument->xinclude() Substitutes XIncludes in a DOMDocument Object