diff --git a/language-snippets.ent b/language-snippets.ent index 23711bc4abcb..864d55929b19 100644 --- a/language-snippets.ent +++ b/language-snippets.ent @@ -1648,30 +1648,40 @@ it is inserted with (e.g.) DOMNo While malformed HTML should load successfully, this function may generate E_WARNING errors when it encounters bad markup. libxml's error handling functions may be used to handle these errors.'> The DOM extension uses UTF-8 encoding. Use mb_convert_encoding, UConverter::transcode, or iconv to handle other encodings.'> + + + The DOM extension uses UTF-8 encoding when working with methods or properties. + The parser methods auto-detect the encoding or allow the caller to specify an encoding. + +'> When using json_encode on a DOMDocument object the result will be that of encoding an empty object.'> - + + Use Dom\HTMLDocument to parse and process modern HTML + instead of DOMDocument. + + This function parses the input using an HTML 4 parser. The parsing rules of HTML 5, which is what modern web browsers use, are different. Depending on the input this might result in a different DOM structure. Therefore this function cannot be safely used for sanitizing HTML. - - + + The behavior when parsing HTML can depend on the version of libxml that is being used, particularly with regards to edge conditions and error handling. For parsing that conforms to the HTML5 specification, use Dom\HTMLDocument::createFromString or Dom\HTMLDocument::createFromFile, added in PHP 8.4. - - + + As an example, some HTML elements will implicitly close a parent element when encountered. The rules for automatically closing parent elements differ between HTML 4 and HTML 5 and thus the resulting DOM structure that DOMDocument sees might be different from the DOM structure a web browser sees, possibly allowing an attacker to break the resulting HTML. - + '> diff --git a/reference/dom/book.xml b/reference/dom/book.xml index d8933f94eab8..2bd037ef1a5b 100644 --- a/reference/dom/book.xml +++ b/reference/dom/book.xml @@ -42,6 +42,35 @@ &reference.dom.domtext; &reference.dom.domxpath; + &reference.dom.dom.dom-adjacentposition; + &reference.dom.dom.dom-attr; + &reference.dom.dom.dom-cdatasection; + &reference.dom.dom.dom-characterdata; + &reference.dom.dom.dom-childnode; + &reference.dom.dom.dom-comment; + &reference.dom.dom.dom-document; + &reference.dom.dom.dom-documentfragment; + &reference.dom.dom.dom-documenttype; + &reference.dom.dom.dom-dtdnamednodemap; + &reference.dom.dom.dom-element; + &reference.dom.dom.dom-entity; + &reference.dom.dom.dom-entityreference; + &reference.dom.dom.dom-htmlcollection; + &reference.dom.dom.dom-htmldocument; + &reference.dom.dom.dom-htmlelement; + &reference.dom.dom.dom-implementation; + &reference.dom.dom.dom-namednodemap; + &reference.dom.dom.dom-namespaceinfo; + &reference.dom.dom.dom-node; + &reference.dom.dom.dom-nodelist; + &reference.dom.dom.dom-notation; + &reference.dom.dom.dom-parentnode; + &reference.dom.dom.dom-processinginstruction; + &reference.dom.dom.dom-text; + &reference.dom.dom.dom-tokenlist; + &reference.dom.dom.dom-xmldocument; + &reference.dom.dom.dom-xpath; + diff --git a/reference/dom/dom/attr/rename.xml b/reference/dom/dom/attr/rename.xml new file mode 100644 index 000000000000..2a58f9f047f6 --- /dev/null +++ b/reference/dom/dom/attr/rename.xml @@ -0,0 +1,174 @@ + + + + Dom\Attr::rename + Changes the qualified name or namespace of an attribute + + + + &reftitle.description; + + public voidDom\Attr::rename + stringnullnamespaceURI + stringqualifiedName + + + This method changes the qualified name or namespace of an attribute. + + + + + &reftitle.parameters; + + + namespaceURI + + + The new namespace URI of the attribute. + + + + + qualifiedName + + + The new qualified name of the attribute. + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.errors; + + + DOMException with code Dom\NAMESPACE_ERR + + + Raised if there is an error with the namespace, as determined by + qualifiedName. + + + + + DOMException with code Dom\INVALID_MODIFICATION_ERR + + + Raised if there already exists an attribute in the element with the same + qualified name. + + + + + + + + &reftitle.examples; + + <methodname>Dom\Attr::rename</methodname> example to change both the namespace and qualified name + + This changes the qualified name of my-attr to + my-new-attr and also changes its namespace to + urn:my-ns. + + +'); + +$root = $doc->documentElement; +$attribute = $root->attributes['my-attr']; +$attribute->rename('urn:my-ns', 'my-new-attr'); + +echo $doc->saveXml(); + +?> +]]> + + &example.outputs; + + + +]]> + + + + <methodname>Dom\Attr::rename</methodname> example to change only the qualified name + + This only changes the qualified name of my-attr + and keeps the namespace URI the same. + + +'); + +$root = $doc->documentElement; +$attribute = $root->attributes['my-attr']; +$attribute->rename($attribute->namespaceURI, 'my-new-attr'); + +echo $doc->saveXml(); + +?> +]]> + + &example.outputs; + + + +]]> + + + + + + &reftitle.notes; + + + It is sometimes necessary to change the qualified name and namespace + URI together in one step to not break any + namespace rules. + + + + + + &reftitle.seealso; + + Dom\Element::rename + + + + + diff --git a/reference/dom/dom/characterdata/after.xml b/reference/dom/dom/characterdata/after.xml new file mode 100644 index 000000000000..abd210f1c2a5 --- /dev/null +++ b/reference/dom/dom/characterdata/after.xml @@ -0,0 +1,78 @@ + + + + Dom\CharacterData::after + + + + + &reftitle.description; + + public voidDom\CharacterData::after + Dom\Nodestringnodes + + + + + + + + + + &reftitle.examples; + + <methodname>Dom\CharacterData::after</methodname> example + + Adds nodes after the character data. + + +"); +$cdata = $doc->documentElement->firstChild; + +$cdata->after("beautiful", $doc->createElement("world")); + +echo $doc->saveXML(); +?> +]]> + + &example.outputs; + + +beautiful +]]> + + + + + + &reftitle.seealso; + + Dom\ChildNode::after + Dom\CharacterData::before + + + + + diff --git a/reference/dom/dom/characterdata/appenddata.xml b/reference/dom/dom/characterdata/appenddata.xml new file mode 100644 index 000000000000..d0d0e46b93ae --- /dev/null +++ b/reference/dom/dom/characterdata/appenddata.xml @@ -0,0 +1,50 @@ + + + + Dom\CharacterData::appendData + + + + + &reftitle.description; + + public voidDom\CharacterData::appendData + stringdata + + + + + + + + + &reftitle.seealso; + + Dom\CharacterData::deleteData + Dom\CharacterData::insertData + Dom\CharacterData::replaceData + Dom\CharacterData::substringData + + + + + diff --git a/reference/dom/dom/characterdata/before.xml b/reference/dom/dom/characterdata/before.xml new file mode 100644 index 000000000000..3bcf13ae87ba --- /dev/null +++ b/reference/dom/dom/characterdata/before.xml @@ -0,0 +1,78 @@ + + + + Dom\CharacterData::before + + + + + &reftitle.description; + + public voidDom\CharacterData::before + Dom\Nodestringnodes + + + + + + + + + + &reftitle.examples; + + <methodname>Dom\CharacterData::before</methodname> example + + Adds nodes before the character data. + + +"); +$cdata = $doc->documentElement->firstChild; + +$cdata->before("hello", $doc->createElement("beautiful")); + +echo $doc->saveXML(); +?> +]]> + + &example.outputs; + + +hello +]]> + + + + + + &reftitle.seealso; + + Dom\ChildNode::before + Dom\CharacterData::after + + + + + diff --git a/reference/dom/dom/characterdata/deletedata.xml b/reference/dom/dom/characterdata/deletedata.xml new file mode 100644 index 000000000000..7da28c71d02d --- /dev/null +++ b/reference/dom/dom/characterdata/deletedata.xml @@ -0,0 +1,52 @@ + + + + Dom\CharacterData::deleteData + + + + + &reftitle.description; + + public voidDom\CharacterData::deleteData + intoffset + intcount + + + + + + + + + + &reftitle.seealso; + + Dom\CharacterData::appendData + Dom\CharacterData::insertData + Dom\CharacterData::replaceData + Dom\CharacterData::substringData + + + + + diff --git a/reference/dom/dom/characterdata/insertdata.xml b/reference/dom/dom/characterdata/insertdata.xml new file mode 100644 index 000000000000..60a4870a241e --- /dev/null +++ b/reference/dom/dom/characterdata/insertdata.xml @@ -0,0 +1,52 @@ + + + + Dom\CharacterData::insertData + + + + + &reftitle.description; + + public voidDom\CharacterData::insertData + intoffset + stringdata + + + + + + + + + + &reftitle.seealso; + + Dom\CharacterData::appendData + Dom\CharacterData::deleteData + Dom\CharacterData::replaceData + Dom\CharacterData::substringData + + + + + diff --git a/reference/dom/dom/characterdata/remove.xml b/reference/dom/dom/characterdata/remove.xml new file mode 100644 index 000000000000..fa9b2a31c617 --- /dev/null +++ b/reference/dom/dom/characterdata/remove.xml @@ -0,0 +1,80 @@ + + + + Dom\CharacterData::remove + + + + + &reftitle.description; + + public voidDom\CharacterData::remove + + + + + + + + + + &reftitle.examples; + + <methodname>Dom\CharacterData::remove</methodname> example + + Removes the character data. + + +"); +$cdata = $doc->documentElement->firstChild; + +$cdata->remove(); + +echo $doc->saveXML(); +?> +]]> + + &example.outputs; + + + +]]> + + + + + + &reftitle.seealso; + + Dom\ChildNode::remove + Dom\CharacterData::after + Dom\CharacterData::before + Dom\CharacterData::replaceWith + Dom\Node::removeChild + + + + + diff --git a/reference/dom/dom/characterdata/replacedata.xml b/reference/dom/dom/characterdata/replacedata.xml new file mode 100644 index 000000000000..6763ab6ae945 --- /dev/null +++ b/reference/dom/dom/characterdata/replacedata.xml @@ -0,0 +1,53 @@ + + + + Dom\CharacterData::replaceData + + + + + &reftitle.description; + + public voidDom\CharacterData::replaceData + intoffset + intcount + stringdata + + + + + + + + + + &reftitle.seealso; + + Dom\CharacterData::appendData + Dom\CharacterData::deleteData + Dom\CharacterData::insertData + Dom\CharacterData::substringData + + + + + diff --git a/reference/dom/dom/characterdata/replacewith.xml b/reference/dom/dom/characterdata/replacewith.xml new file mode 100644 index 000000000000..9e41aad17c45 --- /dev/null +++ b/reference/dom/dom/characterdata/replacewith.xml @@ -0,0 +1,80 @@ + + + + Dom\CharacterData::replaceWith + + + + + &reftitle.description; + + public voidDom\CharacterData::replaceWith + Dom\Nodestringnodes + + + + + + + + + + &reftitle.examples; + + <methodname>Dom\CharacterData::replaceWith</methodname> example + + Replaces the character data with new nodes. + + +"); +$cdata = $doc->documentElement->firstChild; + +$cdata->replaceWith("beautiful", $doc->createElement("world")); + +echo $doc->saveXML(); +?> +]]> + + &example.outputs; + + +beautiful +]]> + + + + + + &reftitle.seealso; + + Dom\ChildNode::replaceWith + Dom\CharacterData::after + Dom\CharacterData::before + Dom\CharacterData::remove + + + + + diff --git a/reference/dom/dom/characterdata/substringdata.xml b/reference/dom/dom/characterdata/substringdata.xml new file mode 100644 index 000000000000..ea95d9e9d5ad --- /dev/null +++ b/reference/dom/dom/characterdata/substringdata.xml @@ -0,0 +1,52 @@ + + + + Dom\CharacterData::substringData + + + + + &reftitle.description; + + public stringDom\CharacterData::substringData + intoffset + intcount + + + + + + + + + + &reftitle.seealso; + + Dom\CharacterData::appendData + Dom\CharacterData::deleteData + Dom\CharacterData::insertData + Dom\CharacterData::replaceData + + + + + diff --git a/reference/dom/dom/childnode/after.xml b/reference/dom/dom/childnode/after.xml new file mode 100644 index 000000000000..b046c87cd0b7 --- /dev/null +++ b/reference/dom/dom/childnode/after.xml @@ -0,0 +1,51 @@ + + + + Dom\ChildNode::after + + + + + &reftitle.description; + + public voidDom\ChildNode::after + Dom\Nodestringnodes + + + + + + + + + + &reftitle.seealso; + + Dom\ChildNode::before + Dom\ChildNode::remove + Dom\ChildNode::replaceWith + Dom\Node::appendChild + + + + + diff --git a/reference/dom/dom/childnode/before.xml b/reference/dom/dom/childnode/before.xml new file mode 100644 index 000000000000..b1bc03224139 --- /dev/null +++ b/reference/dom/dom/childnode/before.xml @@ -0,0 +1,50 @@ + + + + Dom\ChildNode::before + + + + + &reftitle.description; + + public voidDom\ChildNode::before + Dom\Nodestringnodes + + + + + + + + + + &reftitle.seealso; + + Dom\ChildNode::after + Dom\ChildNode::remove + Dom\ChildNode::replaceWith + + + + + diff --git a/reference/dom/dom/childnode/remove.xml b/reference/dom/dom/childnode/remove.xml new file mode 100644 index 000000000000..c6677b6264b5 --- /dev/null +++ b/reference/dom/dom/childnode/remove.xml @@ -0,0 +1,50 @@ + + + + Dom\ChildNode::remove + + + + + &reftitle.description; + + public voidDom\ChildNode::remove + + + + + + + + + + &reftitle.seealso; + + Dom\ChildNode::after + Dom\ChildNode::before + Dom\ChildNode::replaceWith + Dom\Node::removeChild + + + + + diff --git a/reference/dom/dom/childnode/replacewith.xml b/reference/dom/dom/childnode/replacewith.xml new file mode 100644 index 000000000000..5896ff77547e --- /dev/null +++ b/reference/dom/dom/childnode/replacewith.xml @@ -0,0 +1,51 @@ + + + + Dom\ChildNode::replaceWith + + + + + &reftitle.description; + + public voidDom\ChildNode::replaceWith + Dom\Nodestringnodes + + + + + + + + + + &reftitle.seealso; + + Dom\ChildNode::after + Dom\ChildNode::before + Dom\ChildNode::remove + Dom\Node::replaceChild + + + + + diff --git a/reference/dom/dom/dom-adjacentposition.xml b/reference/dom/dom/dom-adjacentposition.xml new file mode 100644 index 000000000000..d2d5ea14125a --- /dev/null +++ b/reference/dom/dom/dom-adjacentposition.xml @@ -0,0 +1,76 @@ + + + The Dom\AdjacentPosition Enum + Dom\AdjacentPosition + + +
+ &reftitle.intro; + + The AdjacentPosition enum is used to specify + where, relative to the context element, insertion should be performed + using Dom\Element::insertAdjacentElement + or Dom\Element::insertAdjacentText. + +
+ +
+ &reftitle.enumsynopsis; + + + AdjacentPosition + + + BeforeBegin + + Insert before the context element. + This is only possible if the element is in a document and has a parent. + + + + + AfterBegin + + Insert before the first child of the context element. + + + + + BeforeEnd + + Insert after the last child of the context element. + + + + + AfterEnd + + Insert after the context element. + This is only possible if the element is in a document and has a parent. + + + + +
+
+
+ diff --git a/reference/dom/dom/dom-attr.xml b/reference/dom/dom/dom-attr.xml new file mode 100644 index 000000000000..93f58b1394d2 --- /dev/null +++ b/reference/dom/dom/dom-attr.xml @@ -0,0 +1,164 @@ + + + + The <classname>Dom\Attr</classname> class + Dom\Attr + + + +
+ &reftitle.intro; + + Dom\Attr represents an attribute in the + Dom\Element object. + + + This is the modern, spec-compliant equivalent of + DOMAttr. + +
+ +
+ &reftitle.classsynopsis; + + + Dom\Attr + + + + extends + Dom\Node + + + &InheritedConstants; + + + + + &Properties; + + public + readonly + stringnull + namespaceURI + + + public + readonly + stringnull + prefix + + + public + readonly + string + localName + + + public + readonly + string + name + + + public + string + value + + + public + readonly + Dom\Elementnull + ownerElement + + + public + readonly + bool + specified + + + &InheritedProperties; + + + + + &Methods; + + + + + &InheritedMethods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + namespaceURI + + The namespace URI of the attribute. + + + + prefix + + The namespace prefix of the attribute. + + + + localName + + The local name of the attribute. + + + + name + + The qualified name of the attribute. + + + + value + + The value of the attribute. + + + Unlike the equivalent property in DOMAttr, + this does not substitute entities. + + + + + + ownerElement + + The element that contains the attribute or &null;. + + + + specified + + Legacy option, always is &true;. + + + +
+ +
+ &reftitle.seealso; + + WHATWG specification of Attr + +
+ +
+ + &reference.dom.dom.entities.attr; + +
diff --git a/reference/dom/dom/dom-cdatasection.xml b/reference/dom/dom/dom-cdatasection.xml new file mode 100644 index 000000000000..bb6f281628d7 --- /dev/null +++ b/reference/dom/dom/dom-cdatasection.xml @@ -0,0 +1,67 @@ + + + + + The Dom\CDATASection class + Dom\CDATASection + + + +
+ &reftitle.intro; + + The Dom\CDATASection class inherits from + Dom\Text for textual representation + of CData constructs. + + + This is the modern, spec-compliant equivalent of + DOMCdataSection. + +
+ +
+ &reftitle.classsynopsis; + + + Dom\CDATASection + + + + extends + Dom\Text + + + &InheritedConstants; + + + + + &InheritedProperties; + + + + + + + + + + + &InheritedMethods; + + + + + + + Not documented yet + + + +
+
+ +
diff --git a/reference/dom/dom/dom-characterdata.xml b/reference/dom/dom/dom-characterdata.xml new file mode 100644 index 000000000000..8c01211d92bd --- /dev/null +++ b/reference/dom/dom/dom-characterdata.xml @@ -0,0 +1,120 @@ + + + + The Dom\CharacterData class + Dom\CharacterData + + +
+ + + + + This is the modern, spec-compliant equivalent of + DOMCharacterData. + +
+ +
+ &reftitle.classsynopsis; + + + Dom\CharacterData + + + + extends + Dom\Node + + + + implements + Dom\ChildNode + + + &InheritedConstants; + + + + + &Properties; + + public + readonly + Dom\Elementnull + previousElementSibling + + + public + readonly + Dom\Elementnull + nextElementSibling + + + public + string + data + + + public + readonly + int + length + + + &InheritedProperties; + + + + + &Methods; + + + + + &InheritedMethods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ &reftitle.seealso; + + WHATWG specification of CharacterData + +
+ +
+ + &reference.dom.dom.entities.characterdata; + +
diff --git a/reference/dom/dom/dom-childnode.xml b/reference/dom/dom/dom-childnode.xml new file mode 100644 index 000000000000..76ee048e58c8 --- /dev/null +++ b/reference/dom/dom/dom-childnode.xml @@ -0,0 +1,35 @@ + + + The Dom\ChildNode interface + Dom\ChildNode + + + +
+ &reftitle.intro; + + This is the modern, spec-compliant equivalent of + DOMChildNode. + +
+ +
+ &reftitle.interfacesynopsis; + + + + Dom\ChildNode + + + &Methods; + + + + +
+ +
+ + &reference.dom.dom.entities.childnode; + +
diff --git a/reference/dom/dom/dom-comment.xml b/reference/dom/dom/dom-comment.xml new file mode 100644 index 000000000000..6b316f97377c --- /dev/null +++ b/reference/dom/dom/dom-comment.xml @@ -0,0 +1,65 @@ + + + + The Dom\Comment class + Dom\Comment + + + +
+ + + + + This is the modern, spec-compliant equivalent of + DOMComment. + +
+ +
+ &reftitle.classsynopsis; + + + + Dom\Comment + + + + extends + Dom\CharacterData + + + &InheritedConstants; + + + + + &InheritedProperties; + + + + + + + + &InheritedMethods; + + + + Not documented yet + + +
+ +
+ &reftitle.seealso; + + WHATWG specification of Comment + +
+ +
+ +
diff --git a/reference/dom/dom/dom-document.xml b/reference/dom/dom/dom-document.xml new file mode 100644 index 000000000000..0c472d5de5e4 --- /dev/null +++ b/reference/dom/dom/dom-document.xml @@ -0,0 +1,252 @@ + + + + The Dom\Document class + Dom\Document + + + +
+ + + + + This is the modern, spec-compliant equivalent of + DOMDocument. + It is the base class for Dom\XMLDocument + and Dom\HTMLDocument. + +
+ +
+ &reftitle.classsynopsis; + + + + abstract + Dom\Document + + + + extends + Dom\Node + + + + implements + Dom\ParentNode + + + &InheritedConstants; + + + + + &Properties; + + public + readonly + Dom\Implementation + implementation + + + public + string + URL + + + public + string + documentURI + + + public + string + characterSet + + + public + string + charset + + + public + string + inputEncoding + + + public + readonly + Dom\DocumentTypenull + doctype + + + public + readonly + Dom\Elementnull + documentElement + + + public + readonly + Dom\Elementnull + firstElementChild + + + public + readonly + Dom\Elementnull + lastElementChild + + + public + readonly + int + childElementCount + + + public + Dom\HTMLElementnull + body + + + public + readonly + Dom\HTMLElementnull + head + + + public + string + title + + + &InheritedProperties; + + + + + &Methods; + Not documented yet + + + &InheritedMethods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + + + + + + + + + + + URL + + Equivalent to documentURI. + + + + characterSet + + + The encoding of the document used for serialization. + Upon parsing a document, this is set to the input encoding of that + document. + + + + + inputEncoding + + Legacy alias for characterSet. + + + + charset + + Legacy alias for characterSet. + + + + + + + + + documentElement + + + The Dom\Element that is the document element. + This evaluates to &null; for document without elements. + + + + + + + + + + + + + + + + + + + + body + + + The first child of the html element that is either a + body tag or a frameset tag. + These need to be in the HTML namespace. + If no element matches, this evaluates to &null;. + + + + + head + + + The first head element that is a child of the + html element. + These need to be in the HTML namespace. + If no element matches, this evaluates to &null;. + + + + + title + + + The title of the document as set by the title + element for HTML or the SVG title element for SVG. + If there is no title, this evaluates to the empty string. + + + + +
+ +
+ + + +
diff --git a/reference/dom/dom/dom-documentfragment.xml b/reference/dom/dom/dom-documentfragment.xml new file mode 100644 index 000000000000..1c5b8390a8e6 --- /dev/null +++ b/reference/dom/dom/dom-documentfragment.xml @@ -0,0 +1,108 @@ + + + + The Dom\DocumentFragment class + Dom\DocumentFragment + + + +
+ &reftitle.intro; + + This represents a document fragment, which can be used as a container for + other nodes. + + + This is the modern, spec-compliant equivalent of + DOMDocumentFragment. + +
+ +
+ &reftitle.classsynopsis; + + + + Dom\DocumentFragment + + + + extends + Dom\Node + + + + implements + Dom\ParentNode + + + &InheritedConstants; + + + + + &Properties; + + public + readonly + Dom\Elementnull + firstElementChild + + + public + readonly + Dom\Elementnull + lastElementChild + + + public + readonly + int + childElementCount + + + &InheritedProperties; + + + + + &Methods; + Not documented yet + + + &InheritedMethods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + + + + + + + + + + + + + + + +
+ +
+ + + +
diff --git a/reference/dom/dom/dom-documenttype.xml b/reference/dom/dom/dom-documenttype.xml new file mode 100644 index 000000000000..30ba11dc6968 --- /dev/null +++ b/reference/dom/dom/dom-documenttype.xml @@ -0,0 +1,144 @@ + + + + The Dom\DocumentType class + Dom\DocumentType + + +
+ &reftitle.intro; + + Each Dom\Document has a doctype + attribute whose value is either &null; or a Dom\DocumentType object. + + + This is the modern, spec-compliant equivalent of + DOMImplementation. + +
+ +
+ &reftitle.classsynopsis; + + + Dom\DocumentType + + + + extends + Dom\Node + + + + implements + Dom\ChildNode + + + &InheritedConstants; + + + + + &Properties; + + public + readonly + string + name + + + public + readonly + Dom\DtdNamedNodeMap + entities + + + public + readonly + Dom\DtdNamedNodeMap + notations + + + public + readonly + string + publicId + + + public + readonly + string + systemId + + + public + readonly + stringnull + internalSubset + + + &InheritedProperties; + + + + + &Methods; + Not documented yet + + + &InheritedMethods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + + + + + + + + + + + + + + + + entities + + + A Dom\DtdNamedNodeMap containing the general + entities, both external and internal, declared in the DTD. + + + + + notations + + + A Dom\DtdNamedNodeMap containing the notations + declared in the DTD. + + + + + + + + + +
+
+ +
diff --git a/reference/dom/dom/dom-dtdnamednodemap.xml b/reference/dom/dom/dom-dtdnamednodemap.xml new file mode 100644 index 000000000000..ea93c0b95498 --- /dev/null +++ b/reference/dom/dom/dom-dtdnamednodemap.xml @@ -0,0 +1,68 @@ + + + + The Dom\DtdNamedNodeMap class + Dom\DtdNamedNodeMap + + + +
+ &reftitle.intro; + + Represents a named node map for entities and notation nodes of the + DTD. + +
+ +
+ &reftitle.classsynopsis; + + + + Dom\DtdNamedNodeMap + + + + implements + IteratorAggregate + + + + Countable + + + &Properties; + + public + readonly + int + length + + + &Methods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + length + + + The total number of entities and notation nodes. + + + + +
+ +
+ + + +
diff --git a/reference/dom/dom/dom-element.xml b/reference/dom/dom/dom-element.xml new file mode 100644 index 000000000000..3df5455fb903 --- /dev/null +++ b/reference/dom/dom/dom-element.xml @@ -0,0 +1,258 @@ + + + + The Dom\Element class + Dom\Element + + + +
+ &reftitle.intro; + + Represents an element. + + + This is the modern, spec-compliant equivalent of + DOMElement. + +
+ +
+ &reftitle.classsynopsis; + + + + Dom\Element + + + + extends + Dom\Node + + + + implements + Dom\ParentNode + + + + Dom\ChildNode + + + &InheritedConstants; + + + + + &Properties; + + public + readonly + stringnull + namespaceURI + + + public + readonly + stringnull + prefix + + + public + readonly + string + localName + + + public + readonly + string + tagName + + + public + string + id + + + public + string + className + + + public + readonly + Dom\TokenList + classList + + + public + readonly + Dom\NamedNodeMap + attributes + + + public + readonly + Dom\Elementnull + firstElementChild + + + public + readonly + Dom\Elementnull + lastElementChild + + + public + readonly + int + childElementCount + + + public + readonly + Dom\Elementnull + previousElementSibling + + + public + readonly + Dom\Elementnull + nextElementSibling + + + public + string + innerHTML + + + public + string + substitutedNodeValue + + + &InheritedProperties; + + + + + &Methods; + Not documented yet + + + &InheritedMethods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + namespaceURI + + The namespace URI of the element. + + + + prefix + + The namespace prefix of the element. + + + + localName + + The local name of the element. + + + + tagName + + The HTML-uppercased qualified name of the element. + + + + + + + + + classList + + + Returns an instance of Dom\TokenList to + easily manage the classes on this element. + + + + + attributes + + + Returns an instance of Dom\NamedNodeMap that + represents the attributes of this element. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + innerHTML + + The inner HTML (or XML for XML documents) of the element. + + + + substitutedNodeValue + + The node value with entity substitution enabled. + + + +
+ +
+ &reftitle.notes; + &dom.note.modern.utf8; +
+ +
+ + + +
diff --git a/reference/dom/dom/dom-entity.xml b/reference/dom/dom/dom-entity.xml new file mode 100644 index 000000000000..19bd810c89f8 --- /dev/null +++ b/reference/dom/dom/dom-entity.xml @@ -0,0 +1,90 @@ + + + + The Dom\Entity class + Dom\Entity + + +
+ + + + + This is the modern, spec-compliant equivalent of + DOMEntity. + +
+ +
+ &reftitle.classsynopsis; + + + Dom\Entity + + + + extends + Dom\Node + + + &InheritedConstants; + + + + + &Properties; + + public + readonly + stringnull + publicId + + + public + readonly + stringnull + systemId + + + public + readonly + stringnull + notationName + + + &InheritedProperties; + + + + + &InheritedMethods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + + + + + + + + + + + + + + + +
+
+ +
diff --git a/reference/dom/dom/dom-entityreference.xml b/reference/dom/dom/dom-entityreference.xml new file mode 100644 index 000000000000..dab7725246d6 --- /dev/null +++ b/reference/dom/dom/dom-entityreference.xml @@ -0,0 +1,50 @@ + + + + The Dom\EntityReference class + Dom\EntityReference + + + +
+ &reftitle.intro; + + This is the modern, spec-compliant equivalent of + DOMEntityReference. + +
+ +
+ &reftitle.classsynopsis; + + + + Dom\EntityReference + + + + extends + Dom\Node + + + &InheritedConstants; + + + + + &InheritedProperties; + + + + + &InheritedMethods; + Not documented yet + + +
+ +
+ +
diff --git a/reference/dom/dom/dom-htmlcollection.xml b/reference/dom/dom/dom-htmlcollection.xml new file mode 100644 index 000000000000..6664ba72999e --- /dev/null +++ b/reference/dom/dom/dom-htmlcollection.xml @@ -0,0 +1,70 @@ + + + + The Dom\HTMLCollection class + Dom\HTMLCollection + + + +
+ &reftitle.intro; + + Represents a static set of elements. + +
+ +
+ &reftitle.classsynopsis; + + + + Dom\HTMLCollection + + + + implements + IteratorAggregate + + + + Countable + + + &Properties; + + public + readonly + int + length + + + &Methods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + length + + The number of elements. + + + +
+ +
+ &reftitle.notes; + &dom.note.modern.utf8; +
+ +
+ + + +
diff --git a/reference/dom/dom/dom-htmldocument.xml b/reference/dom/dom/dom-htmldocument.xml new file mode 100644 index 000000000000..ce9d564fdae4 --- /dev/null +++ b/reference/dom/dom/dom-htmldocument.xml @@ -0,0 +1,69 @@ + + + + The Dom\HTMLDocument class + Dom\HTMLDocument + + + +
+ &reftitle.intro; + + Represents an HTML document. + +
+ +
+ &reftitle.classsynopsis; + + + + final + Dom\HTMLDocument + + + + extends + Dom\Document + + + &InheritedConstants; + + + + + &InheritedProperties; + + + + + + + + &Methods; + Not documented yet + + + &InheritedMethods; + Not documented yet + + + +
+ +
+ &reftitle.notes; + &dom.note.modern.utf8; +
+ +
+ + + +
diff --git a/reference/dom/dom/dom-htmlelement.xml b/reference/dom/dom/dom-htmlelement.xml new file mode 100644 index 000000000000..e46c08b528e8 --- /dev/null +++ b/reference/dom/dom/dom-htmlelement.xml @@ -0,0 +1,60 @@ + + + + The Dom\HTMLElement class + Dom\HTMLElement + + + +
+ &reftitle.intro; + + Represents an element in the HTML namespace. + +
+ +
+ &reftitle.classsynopsis; + + + + Dom\HTMLElement + + + + extends + Dom\Element + + + &InheritedConstants; + + + + + &InheritedProperties; + + + + + + + + &InheritedMethods; + Not documented yet + + + +
+ +
+ &reftitle.notes; + &dom.note.modern.utf8; +
+ +
+ +
diff --git a/reference/dom/dom/dom-implementation.xml b/reference/dom/dom/dom-implementation.xml new file mode 100644 index 000000000000..dcbd68fe9912 --- /dev/null +++ b/reference/dom/dom/dom-implementation.xml @@ -0,0 +1,42 @@ + + + + The Dom\Implementation class + Dom\Implementation + + + +
+ &reftitle.intro; + + + + + + + This is the modern, spec-compliant equivalent of + DOMImplementation. + +
+ +
+ &reftitle.classsynopsis; + + + Dom\Implementation + + + &Methods; + Not documented yet + + + +
+ +
+ + + +
diff --git a/reference/dom/dom/dom-namednodemap.xml b/reference/dom/dom/dom-namednodemap.xml new file mode 100644 index 000000000000..319913b05b96 --- /dev/null +++ b/reference/dom/dom/dom-namednodemap.xml @@ -0,0 +1,70 @@ + + + + The Dom\NamedNodeMap class + Dom\NamedNodeMap + + + +
+ &reftitle.intro; + + Represents the set of attributes on an element. + +
+ +
+ &reftitle.classsynopsis; + + + + Dom\NamedNodeMap + + + + implements + IteratorAggregate + + + + Countable + + + &Properties; + + public + readonly + int + length + + + &Methods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + length + + The number of attributes. + + + +
+ +
+ &reftitle.notes; + &dom.note.modern.utf8; +
+ +
+ + + +
diff --git a/reference/dom/dom/dom-namespaceinfo.xml b/reference/dom/dom/dom-namespaceinfo.xml new file mode 100644 index 000000000000..11d871b57bc9 --- /dev/null +++ b/reference/dom/dom/dom-namespaceinfo.xml @@ -0,0 +1,74 @@ + + + + The Dom\NamespaceInfo class + Dom\NamespaceInfo + + +
+ &reftitle.intro; + + This represents immutable information about namespaces of an element. + This decouples namespaces from attributes, which was incorrectly intertwined for the old DOM classes. + +
+ +
+ &reftitle.classsynopsis; + + + final + readonly + Dom\NamespaceInfo + + + &Properties; + + public + stringnull + prefix + + + public + stringnull + namespaceURI + + + public + Dom\Element + element + + + + +
+ +
+ &reftitle.properties; + + + prefix + + The namespace prefix of the attribute. + + + + namespaceURI + + The namespace URI of the attribute. + + + + element + + The element that this namespace information is about. + + + +
+
+ +
diff --git a/reference/dom/dom/dom-node.xml b/reference/dom/dom/dom-node.xml new file mode 100644 index 000000000000..036785629a3a --- /dev/null +++ b/reference/dom/dom/dom-node.xml @@ -0,0 +1,308 @@ + + + + The Dom\Node class + Dom\Node + + + +
+ &reftitle.intro; + + This is the modern, spec-compliant equivalent of + DOMNode. + +
+ +
+ &reftitle.classsynopsis; + + + Dom\Node + + + &Constants; + + public + const + int + Dom\Node::DOCUMENT_POSITION_DISCONNECTED + 0x1 + + + public + const + int + Dom\Node::DOCUMENT_POSITION_PRECEDING + 0x2 + + + public + const + int + Dom\Node::DOCUMENT_POSITION_FOLLOWING + 0x4 + + + public + const + int + Dom\Node::DOCUMENT_POSITION_CONTAINS + 0x8 + + + public + const + int + Dom\Node::DOCUMENT_POSITION_CONTAINED_BY + 0x10 + + + public + const + int + Dom\Node::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC + 0x20 + + + &Properties; + + public + readonly + int + nodeType + + + public + readonly + string + nodeName + + + public + readonly + string + baseURI + + + public + readonly + bool + isConnected + + + public + readonly + Dom\Documentnull + ownerDocument + + + public + readonly + Dom\Nodenull + parentNode + + + public + readonly + Dom\Elementnull + parentElement + + + public + readonly + Dom\NodeList + childNodes + + + public + readonly + Dom\Nodenull + firstChild + + + public + readonly + Dom\Nodenull + lastChild + + + public + readonly + Dom\Nodenull + previousSibling + + + public + readonly + Dom\Nodenull + nextSibling + + + public + stringnull + nodeValue + + + public + stringnull + textContent + + + &Methods; + Not documented yet + + + +
+ +
+ &reftitle.constants; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ &reftitle.properties; + + + + + + + + nodeName + + Returns the most accurate name for the current node type. + + For elements, this is the HTML-uppercased qualified name. + For attributes, this is the qualified name. + For processing instructions, this is the target. + For document type nodes, this is the name. + + + + + + + + + + + + + + + ownerDocument + + + The Dom\Document object associated with + this node, or &null; if this node is a document. + + + + + + + + + + + + + + + childNodes + + + A Dom\NodeList that contains all + children of this node. If there are no children, this is an empty + Dom\NodeList. + + + + + + + + + + + + + + + + + + + + + + + + + nodeValue + + + The value of this node, depending on its type. + + + + + + + + + +
+ +
+ &reftitle.notes; + &dom.note.modern.utf8; +
+ +
+ &reftitle.seealso; + + WHATWG specification of Node + +
+ +
+ + + +
diff --git a/reference/dom/dom/dom-nodelist.xml b/reference/dom/dom/dom-nodelist.xml new file mode 100644 index 000000000000..975f3767cede --- /dev/null +++ b/reference/dom/dom/dom-nodelist.xml @@ -0,0 +1,65 @@ + + + + The <classname>Dom\NodeList</classname> class + Dom\NodeList + + + +
+ + + + + This is the modern, spec-compliant equivalent of + DOMNodeList. + +
+ +
+ &reftitle.classsynopsis; + + + Dom\NodeList + + + + implements + IteratorAggregate + + + + Countable + + + &Properties; + + public + readonly + int + length + + + &Methods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + + + + + +
+
+ + + +
diff --git a/reference/dom/dom/dom-notation.xml b/reference/dom/dom/dom-notation.xml new file mode 100644 index 000000000000..a30ed41cef42 --- /dev/null +++ b/reference/dom/dom/dom-notation.xml @@ -0,0 +1,71 @@ + + + + The Dom\Notation class + Dom\Notation + + + +
+ &reftitle.classsynopsis; + + + Dom\Notation + + + + extends + Dom\Node + + + &InheritedConstants; + + + + + &Properties; + + public + readonly + string + publicId + + + public + readonly + string + systemId + + + &InheritedProperties; + + + + + &InheritedMethods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + + + + + + + + + + +
+ +
+ +
diff --git a/reference/dom/dom/dom-parentnode.xml b/reference/dom/dom/dom-parentnode.xml new file mode 100644 index 000000000000..2fb3a0dbe350 --- /dev/null +++ b/reference/dom/dom/dom-parentnode.xml @@ -0,0 +1,36 @@ + + + The Dom\ParentNode interface + Dom\ParentNode + + + +
+ &reftitle.intro; + + This is the modern, spec-compliant equivalent of + DOMParentNode. + +
+ +
+ &reftitle.interfacesynopsis; + + + + Dom\ParentNode + + + &Methods; + + + + + +
+ +
+ + &reference.dom.dom.entities.parentnode; + +
diff --git a/reference/dom/dom/dom-processinginstruction.xml b/reference/dom/dom/dom-processinginstruction.xml new file mode 100644 index 000000000000..a409ea379e18 --- /dev/null +++ b/reference/dom/dom/dom-processinginstruction.xml @@ -0,0 +1,77 @@ + + + + The Dom\ProcessingInstruction class + Dom\ProcessingInstruction + + + +
+ + + + + This is the modern, spec-compliant equivalent of + DOMProcessingInstruction. + +
+ +
+ &reftitle.classsynopsis; + + + + Dom\ProcessingInstruction + + + + extends + Dom\CharacterData + + + &InheritedConstants; + + + + + &Properties; + + public + readonly + string + target + + + &InheritedProperties; + + + + + + + + &InheritedMethods; + + + + Not documented yet + + +
+ +
+ &reftitle.properties; + + + + + + + +
+ +
+ +
diff --git a/reference/dom/dom/dom-text.xml b/reference/dom/dom/dom-text.xml new file mode 100644 index 000000000000..2644a690dcfb --- /dev/null +++ b/reference/dom/dom/dom-text.xml @@ -0,0 +1,86 @@ + + + + The Dom\Text class + Dom\Text + + + +
+ &reftitle.intro; + + The Dom\Text class inherits from + Dom\CharacterData and represents a text node. + + + This is the modern, spec-compliant equivalent of + DOMText. + +
+ +
+ &reftitle.classsynopsis; + + + + Dom\Text + + + + extends + Dom\CharacterData + + + &InheritedConstants; + + + + + &Properties; + + public + readonly + string + wholeText + + + &InheritedProperties; + + + + + + + + &Methods; + + + + + &InheritedMethods; + + + + Not documented yet + + +
+ +
+ &reftitle.properties; + + + + + + + +
+ +
+ + &reference.dom.dom.entities.text; + +
diff --git a/reference/dom/dom/dom-tokenlist.xml b/reference/dom/dom/dom-tokenlist.xml new file mode 100644 index 000000000000..7668819d3291 --- /dev/null +++ b/reference/dom/dom/dom-tokenlist.xml @@ -0,0 +1,85 @@ + + + + The Dom\TokenList class + Dom\TokenList + + + +
+ &reftitle.intro; + + Represents a set of tokens in an attribute (e.g. class names). + +
+ +
+ &reftitle.classsynopsis; + + + + final + Dom\TokenList + + + + implements + IteratorAggregate + + + + Countable + + + &Properties; + + public + readonly + int + length + + + public + string + value + + + &Methods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + length + + The number of tokens. + + + + value + + The value of the attribute linked to this object. + + + +
+ +
+ &reftitle.notes; + &dom.note.modern.utf8; +
+ +
+ + + +
diff --git a/reference/dom/dom/dom-xmldocument.xml b/reference/dom/dom/dom-xmldocument.xml new file mode 100644 index 000000000000..76ea07c46a6e --- /dev/null +++ b/reference/dom/dom/dom-xmldocument.xml @@ -0,0 +1,127 @@ + + + + The Dom\XMLDocument class + Dom\XMLDocument + + + +
+ &reftitle.intro; + + Represents an XML document. + +
+ +
+ &reftitle.classsynopsis; + + + + final + Dom\XMLDocument + + + + extends + Dom\Document + + + &InheritedConstants; + + + + + &Properties; + + public + readonly + string + xmlEncoding + + + public + bool + xmlStandalone + + + public + string + xmlVersion + + + public + bool + formatOutput + + + &InheritedProperties; + + + + + + + + &Methods; + Not documented yet + + + &InheritedMethods; + Not documented yet + + + +
+ +
+ &reftitle.properties; + + + While the DOMDocument class allows setting certain + properties to influence parser behaviour, this class only uses the + LIBXML_* constants to + configure the parser. + + + + + + + + + + + + + + + + + + + + formatOutput + + Nicely formats output with indentation and extra space. + + + +
+ +
+ &reftitle.notes; + &dom.note.modern.utf8; +
+ +
+ + + +
diff --git a/reference/dom/dom/dom-xpath.xml b/reference/dom/dom/dom-xpath.xml new file mode 100644 index 000000000000..9dc15d192364 --- /dev/null +++ b/reference/dom/dom/dom-xpath.xml @@ -0,0 +1,72 @@ + + + + The Dom\XPath class + Dom\XPath + + + +
+ + + + + This is the modern, spec-compliant equivalent of + DOMXPath. + +
+ +
+ &reftitle.classsynopsis; + + + + final + Dom\XPath + + + &Properties; + + public + readonly + Dom\Document + document + + + public + bool + registerNodeNamespaces + + + &Methods; + Not documented yet + + +
+ +
+ &reftitle.properties; + + + + + + + + + + + + +
+ +
+ + + +
diff --git a/reference/dom/dom/parentnode/append.xml b/reference/dom/dom/parentnode/append.xml new file mode 100644 index 000000000000..25b84d54fd03 --- /dev/null +++ b/reference/dom/dom/parentnode/append.xml @@ -0,0 +1,48 @@ + + + + Dom\ParentNode::append + + + + + &reftitle.description; + + public voidDom\ParentNode::append + Dom\Nodestringnodes + + + + + + + + + + &reftitle.seealso; + + Dom\ParentNode::prepend + + + + + diff --git a/reference/dom/dom/parentnode/prepend.xml b/reference/dom/dom/parentnode/prepend.xml new file mode 100644 index 000000000000..3c348de60d51 --- /dev/null +++ b/reference/dom/dom/parentnode/prepend.xml @@ -0,0 +1,48 @@ + + + + Dom\ParentNode::prepend + + + + + &reftitle.description; + + public voidDom\ParentNode::prepend + Dom\Nodestringnodes + + + + + + + + + + &reftitle.seealso; + + Dom\ParentNode::append + + + + + diff --git a/reference/dom/dom/parentnode/queryselector.xml b/reference/dom/dom/parentnode/queryselector.xml new file mode 100644 index 000000000000..fb2f0115f1d9 --- /dev/null +++ b/reference/dom/dom/parentnode/queryselector.xml @@ -0,0 +1,78 @@ + + + + Dom\ParentNode::querySelector + Returns the first element that matches the CSS selectors + + + + &reftitle.description; + + public Dom\ElementnullDom\ParentNode::querySelector + stringselectors + + + Returns the first element that matches the CSS selectors specified + in selectors. + + + + + &reftitle.parameters; + + + selectors + + + A string containing one or more CSS selectors. + + + + + + + + &reftitle.returnvalues; + + Returns the first Dom\Element that matches + selectors. Returns &null; if no element matches. + + + + + &reftitle.errors; + + Throws a DOMException with code + Dom\SYNTAX_ERR when selectors + is not a valid CSS selector string. + + + + + &reftitle.seealso; + + Dom\ParentNode::querySelectorAll + + + + + diff --git a/reference/dom/dom/parentnode/queryselectorall.xml b/reference/dom/dom/parentnode/queryselectorall.xml new file mode 100644 index 000000000000..1c2377eb8978 --- /dev/null +++ b/reference/dom/dom/parentnode/queryselectorall.xml @@ -0,0 +1,59 @@ + + + + Dom\ParentNode::querySelectorAll + Returns a collection of elements that match the CSS selectors + + + + &reftitle.description; + + public Dom\NodeListDom\ParentNode::querySelectorAll + stringselectors + + + Returns a collection of elements that match the CSS selectors specified + in selectors. + + + + + + + &reftitle.returnvalues; + + Returns a static collection of elements that match the CSS selectors + specified in selectors. + + + + + + + &reftitle.seealso; + + Dom\ParentNode::querySelector + + + + + diff --git a/reference/dom/dom/parentnode/replacechildren.xml b/reference/dom/dom/parentnode/replacechildren.xml new file mode 100644 index 000000000000..569a83a28898 --- /dev/null +++ b/reference/dom/dom/parentnode/replacechildren.xml @@ -0,0 +1,64 @@ + + + + Dom\ParentNode::replaceChildren + + + + + &reftitle.description; + + public voidDom\ParentNode::replaceChildren + Dom\Nodestringnodes + + + + + + + + + + &reftitle.examples; + + <methodname>Dom\ParentNode::replaceChildren</methodname> example + +

hi

test

hi2

'); + +$dom->documentElement->replaceChildren('foo', $dom->createElement('p'), 'bar'); +echo $dom->saveHtml(); +?> +]]> +
+ &example.outputs; + +foo

bar +]]> +
+
+
+ +
+ diff --git a/reference/dom/dom/text/splittext.xml b/reference/dom/dom/text/splittext.xml new file mode 100644 index 000000000000..501f4c82cd6e --- /dev/null +++ b/reference/dom/dom/text/splittext.xml @@ -0,0 +1,39 @@ + + + + Dom\Text::splitText + + + + + &reftitle.description; + + public Dom\TextDom\Text::splitText + intoffset + + + + + + + + diff --git a/reference/dom/domattr/isid.xml b/reference/dom/domattr/isid.xml index 8b468896c55a..c34997af6143 100644 --- a/reference/dom/domattr/isid.xml +++ b/reference/dom/domattr/isid.xml @@ -31,9 +31,9 @@ &reftitle.returnvalues; - - &return.success; - + + Returns &true; if this attribute is a defined ID, &false; otherwise. + &reftitle.examples; @@ -44,11 +44,11 @@ validateOnParse = true; -$doc->Load('book.xml'); +$doc->load('book.xml'); // We retrieve the attribute named id of the chapter element $attr = $doc->getElementsByTagName('chapter')->item(0)->getAttributeNode('id'); diff --git a/reference/dom/domcdatasection.xml b/reference/dom/domcdatasection.xml index e70756d6c84d..14cb8312f964 100644 --- a/reference/dom/domcdatasection.xml +++ b/reference/dom/domcdatasection.xml @@ -11,7 +11,7 @@
&reftitle.intro; - The DOMCdataSection inherits from + The DOMCdataSection class inherits from DOMText for textual representation of CData constructs. diff --git a/reference/dom/domcharacterdata/after.xml b/reference/dom/domcharacterdata/after.xml index 00e7714810fb..f0be9e40bdc5 100644 --- a/reference/dom/domcharacterdata/after.xml +++ b/reference/dom/domcharacterdata/after.xml @@ -12,7 +12,7 @@ DOMNodestringnodes - Adds the passed nodes after the element. + Adds the passed nodes after the character data. diff --git a/reference/dom/domcharacterdata/before.xml b/reference/dom/domcharacterdata/before.xml index fb2dac93161b..e3ee7ece9858 100644 --- a/reference/dom/domcharacterdata/before.xml +++ b/reference/dom/domcharacterdata/before.xml @@ -2,7 +2,7 @@ DOMCharacterData::before - Adds nodes before the node + Adds nodes before the character data @@ -12,7 +12,7 @@ DOMNodestringnodes - Adds the passed nodes before the node. + Adds the passed nodes before the character data. diff --git a/reference/dom/domcharacterdata/deletedata.xml b/reference/dom/domcharacterdata/deletedata.xml index fba6fb888242..bc18fca2dff3 100644 --- a/reference/dom/domcharacterdata/deletedata.xml +++ b/reference/dom/domcharacterdata/deletedata.xml @@ -4,7 +4,7 @@ DOMCharacterData::deleteData - Remove a range of characters from the node + Remove a range of characters from the character data @@ -59,7 +59,7 @@ Raised if offset is negative or greater than the - number of 16-bit units in data, or if count is + number of UTF-8 codepoints in data, or if count is negative. diff --git a/reference/dom/domcharacterdata/insertdata.xml b/reference/dom/domcharacterdata/insertdata.xml index 0313d4947748..0287ed3c685f 100644 --- a/reference/dom/domcharacterdata/insertdata.xml +++ b/reference/dom/domcharacterdata/insertdata.xml @@ -4,7 +4,7 @@ DOMCharacterData::insertData - Insert a string at the specified 16-bit unit offset + Insert a string at the specified UTF-8 codepoint offset @@ -56,7 +56,7 @@ Raised if offset is negative or greater than the - number of 16-bit units in data. + number of UTF-8 codepoints in data. diff --git a/reference/dom/domcharacterdata/remove.xml b/reference/dom/domcharacterdata/remove.xml index 9c178b2bc7d1..ace20823aeaf 100644 --- a/reference/dom/domcharacterdata/remove.xml +++ b/reference/dom/domcharacterdata/remove.xml @@ -2,7 +2,7 @@ DOMCharacterData::remove - Removes the character data + Removes the character data node @@ -12,7 +12,7 @@ - Removes the character data. + Removes the character data node. diff --git a/reference/dom/domcharacterdata/replacedata.xml b/reference/dom/domcharacterdata/replacedata.xml index 8e408ddc46f6..b42d60de31cc 100644 --- a/reference/dom/domcharacterdata/replacedata.xml +++ b/reference/dom/domcharacterdata/replacedata.xml @@ -4,7 +4,7 @@ DOMCharacterData::replaceData - Replace a substring within the DOMCharacterData node + Replace a substring within the character data @@ -68,7 +68,7 @@ Raised if offset is negative or greater than the - number of 16-bit units in data, or if count is + number of UTF-8 codepoints in data, or if count is negative. diff --git a/reference/dom/domcharacterdata/substringdata.xml b/reference/dom/domcharacterdata/substringdata.xml index 78c7c7ae6e7e..1212f85baf16 100644 --- a/reference/dom/domcharacterdata/substringdata.xml +++ b/reference/dom/domcharacterdata/substringdata.xml @@ -4,7 +4,7 @@ DOMCharacterData::substringData - Extracts a range of data from the node + Extracts a range of data from the character data @@ -45,7 +45,7 @@ &reftitle.returnvalues; The specified substring. If the sum of offset - and count exceeds the length, then all 16-bit units + and count exceeds the length, then all UTF-8 codepoints to the end of the data are returned. @@ -58,7 +58,7 @@ Raised if offset is negative or greater than the - number of 16-bit units in data, or if count is + number of UTF-8 codepoints in data, or if count is negative. diff --git a/reference/dom/domdocumenttype.xml b/reference/dom/domdocumenttype.xml index b24121830dfd..fe8545816ab8 100644 --- a/reference/dom/domdocumenttype.xml +++ b/reference/dom/domdocumenttype.xml @@ -102,7 +102,7 @@ The system identifier of the external subset. This may be an - absolute URI or not. + absolute URI or not. @@ -110,7 +110,7 @@ name - The name of DTD; i.e., the name immediately following the + The name of DTD; i.e., the name immediately following the DOCTYPE keyword. @@ -120,7 +120,7 @@ A DOMNamedNodeMap containing the general - entities, both external and internal, declared in the DTD. + entities, both external and internal, declared in the DTD. @@ -129,7 +129,7 @@ A DOMNamedNodeMap containing the notations - declared in the DTD. + declared in the DTD. diff --git a/reference/dom/domelement.xml b/reference/dom/domelement.xml index 15ad52fc4d07..94b66527d8ba 100644 --- a/reference/dom/domelement.xml +++ b/reference/dom/domelement.xml @@ -170,13 +170,13 @@ className - A string representing the classes of the element separated by spaces + A string representing the classes of the element separated by spaces. id - The element ID + Reflects the element ID through the "id" attribute. diff --git a/reference/dom/domexception.xml b/reference/dom/domexception.xml index f573152a1e9f..bee004bb55ca 100644 --- a/reference/dom/domexception.xml +++ b/reference/dom/domexception.xml @@ -9,7 +9,7 @@ FIXME: Remove me once you perform substitutions dom --> - The DOMException class + The DOMException / Dom\Exception class DOMException @@ -17,10 +17,14 @@ FIXME: Remove me once you perform substitutions
&reftitle.intro; - + DOM operations raise exceptions under particular circumstances, i.e., when an operation is impossible to perform for logical reasons. - + + + This class is aliased as Dom\Exception in the + Dom namespace. + See also . diff --git a/reference/dom/domimplementation.xml b/reference/dom/domimplementation.xml index ce1cbfa6a294..b3d169af6b6e 100644 --- a/reference/dom/domimplementation.xml +++ b/reference/dom/domimplementation.xml @@ -15,11 +15,11 @@ Remove me once you perform substitutions
&reftitle.intro; - - The DOMImplementation class provides a number + + This class provides a number of methods for performing operations that are independent of any particular instance of the document object model. - +
diff --git a/reference/dom/domnodelist.xml b/reference/dom/domnodelist.xml index e1e800b9fff1..c9450c2e083d 100644 --- a/reference/dom/domnodelist.xml +++ b/reference/dom/domnodelist.xml @@ -12,16 +12,12 @@ Remove me once you perform substitutions - - -
&reftitle.classsynopsis; diff --git a/reference/dom/domnotation.xml b/reference/dom/domnotation.xml index 1fea3eb76fa5..a437bd0c5aaf 100644 --- a/reference/dom/domnotation.xml +++ b/reference/dom/domnotation.xml @@ -74,21 +74,20 @@ Remove me once you perform substitutions
-
&reftitle.properties; publicId - + The public identifier associated with the notation. systemId - + The system identifier associated with the notation. diff --git a/reference/dom/domprocessinginstruction.xml b/reference/dom/domprocessinginstruction.xml index 310b877b7fc4..aadb785d2c4e 100644 --- a/reference/dom/domprocessinginstruction.xml +++ b/reference/dom/domprocessinginstruction.xml @@ -6,16 +6,13 @@ - - -
&reftitle.classsynopsis; @@ -69,21 +66,20 @@
-
&reftitle.properties; target - + A string representing to what application the data is intended for. data - + Application-specific data. diff --git a/reference/dom/domxpath.xml b/reference/dom/domxpath.xml index d3c70124a563..5320a119a5c0 100644 --- a/reference/dom/domxpath.xml +++ b/reference/dom/domxpath.xml @@ -15,9 +15,9 @@ Remove me once you perform substitutions
&reftitle.intro; - - Supports XPath 1.0 - + + Allows to use XPath 1.0 queries on HTML or XML documents. +
@@ -56,20 +56,19 @@ Remove me once you perform substitutions
-
&reftitle.properties; document - + The document that is linked to this object. registerNodeNamespaces - When set to &true;, namespaces in the node are registered. + When set to &true;, namespaces in the node are registered. diff --git a/reference/dom/functions/dom-import-simplexml.xml b/reference/dom/functions/dom-import-simplexml.xml index 0ad2db69f7b9..3c2fcdc1b1a2 100644 --- a/reference/dom/functions/dom-import-simplexml.xml +++ b/reference/dom/functions/dom-import-simplexml.xml @@ -4,7 +4,7 @@ dom_import_simplexml - Gets a DOMElement object from a + Gets a DOMAttr or DOMElement object from a SimpleXMLElement object diff --git a/reference/dom/functions/dom-ns-import-simplexml.xml b/reference/dom/functions/dom-ns-import-simplexml.xml new file mode 100644 index 000000000000..c8ae4cc1f324 --- /dev/null +++ b/reference/dom/functions/dom-ns-import-simplexml.xml @@ -0,0 +1,93 @@ + + + + + Dom\import_simplexml + + Gets a Dom\Attr or Dom\Element object from a + SimpleXMLElement object + + + + &reftitle.description; + + Dom\AttrDom\ElementDom\import_simplexml + objectnode + + + This function takes the given attribute or element node (a + SimpleXMLElement instance) and creates a + Dom\Attr or Dom\Element node, repectively. + The new Dom\Node refers to the same underlying XML node + as the SimpleXMLElement. + + + + + + + + + + + &reftitle.returnvalues; + + The Dom\Attr or Dom\Element. + + + + + &reftitle.examples; + + Import SimpleXML into DOM and modify SimpleXML through DOM + + Error handling omitted for brevity. + + +blah'); +$elt = Dom\import_simplexml($sxe); +$elt->setAttribute("foo", "bar"); +echo $sxe->asXML(); + +?> +]]> + + &example.outputs; + + +blah +]]> + + + + + &reftitle.seealso; + + simplexml_import_dom + + + + diff --git a/reference/dom/versions.xml b/reference/dom/versions.xml index 33075c62c4ff..514f4b0e865f 100644 --- a/reference/dom/versions.xml +++ b/reference/dom/versions.xml @@ -200,18 +200,61 @@ + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + XSLTProcessor::transformToXml Transform to XML @@ -17,20 +17,9 @@ - &reftitle.parameters; - - - - document - - - The DOMDocument or SimpleXMLElement object to - be transformed. - - - - - + + + &reftitle.returnvalues; @@ -38,6 +27,29 @@ The result of the transformation as a string or &false; on error. + + + &reftitle.changelog; + + + + + &Version; + &Description; + + + + + 8.4.0 + + Added support for Dom\Document. + + + + + + + &reftitle.examples; @@ -68,6 +80,34 @@ echo $proc->transformToXML($xml); Fight for your mind

by Ben Harper - 1995


+

Electric Ladyland

by Jimi Hendrix - 1997


+]]> + + + + Transforming to a string using <classname>Dom\Document</classname> + +importStyleSheet($xsl); // attach the xsl rules + +echo $proc->transformToXML($xml); + +?> +]]> + + &example.outputs; + +Fight for your mind

by Ben Harper - 1995


Electric Ladyland

by Jimi Hendrix - 1997


]]> @@ -75,6 +115,7 @@ Hey! Welcome to Nicolas Eliaszewicz's sweet CD collection!
+ &reftitle.seealso;