diff --git a/reference/dom/functions/dom-domdocument-registernodeclass.xml b/reference/dom/functions/dom-domdocument-registernodeclass.xml
index 0a395b90df..37162a587d 100644
--- a/reference/dom/functions/dom-domdocument-registernodeclass.xml
+++ b/reference/dom/functions/dom-domdocument-registernodeclass.xml
@@ -1,20 +1,112 @@
-
+
- DOMDocument::registerNodeClass
+ DOMDocument->registerNodeClass()
Register extended class used to create base node type
&reftitle.description;
-
- boolDOMDocument::registerNodeClass
- stringbaseclass
- stringextendedclass
-
+
+ DOMDocument
+
+ boolregisterNodeClass
+ stringbaseclass
+ stringextendedclass
+
+
- &warn.undocumented.func;
+
+ This method allows you to register your own extended DOM class to be used
+ afterward by the PHP DOM extension.
+
+
+ This method is not part of the DOM standard.
+
+
+
+ &reftitle.parameters;
+
+
+
+ baseclass
+
+
+ The DOM class that you want to extend. You can find a list of these
+ classes in the chapter introduction.
+
+
+ Of course, you won't be able to register a class extending DOMDocument
+ but you can always start your document by instanciating your own
+ extending class.
+
+
+
+
+ extendedclass
+
+
+ Your extended class name. If &null; is provided, any previously
+ registered class extending baseclass will
+ be removed.
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.success;
+
+
+
+
+ &reftitle.examples;
+
+
+ Adding a new method to DOMElement to ease our code
+
+appendChild(new myElement($name));
+ }
+}
+
+class myDocument extends DOMDocument {
+ function setRoot($name) {
+ return $this->appendChild(new myElement($name));
+ }
+}
+
+$doc = new myDocument();
+$doc->registerNodeClass('DOMElement', 'myElement');
+
+// From now on, adding an element to another costs only one method call !
+$root = $doc->setRoot('root');
+$child = $root->appendElement('child');
+$child->setAttribute('foo', 'bar');
+
+echo $doc->saveXML();
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+]]>
+
+
+
diff --git a/reference/dom/functions/dom-domdocumentfragment-appendxml.xml b/reference/dom/functions/dom-domdocumentfragment-appendxml.xml
index b16d4534b2..f4e7eacbf9 100644
--- a/reference/dom/functions/dom-domdocumentfragment-appendxml.xml
+++ b/reference/dom/functions/dom-domdocumentfragment-appendxml.xml
@@ -1,10 +1,10 @@
-
+
-
+
DOMDocumentFragment->appendXML()
- Append XML data
+ Append raw XML data
&reftitle.description;
@@ -15,9 +15,18 @@
stringdata
-
- &warn.undocumented.func;
-
+
+ Appends raw XML data to a DOMDocumentFragment.
+
+
+ This method is not part of the DOM standard. It was created as a simplier
+ approach for appending an XML DocumentFragment in a DOMDocument.
+
+
+ If you want to stick to the standards, you will have to create a temporary
+ DOMDocument with a dummy root and then loop through the child nodes of the
+ root of your XML data to append them.
+
&reftitle.parameters;
@@ -41,85 +50,33 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/reference/dom/reference.xml b/reference/dom/reference.xml
index 455280ffce..9b19e550be 100644
--- a/reference/dom/reference.xml
+++ b/reference/dom/reference.xml
@@ -1,5 +1,5 @@
-
+
@@ -262,6 +262,9 @@
- Performs relaxNG validation on the document
+
+ - Register extended class used to create base node type (not DOM standard)
+
- Dumps the internal XML tree back into a file
@@ -447,6 +450,21 @@
+
+ DOMDocumentFragment
+
+ Extends DOMNode.
+
+
+ &reftitle.methods;
+
+
+ - Append raw XML data (not DOM standard)
+
+
+
+
+
DOMDocumentType
@@ -1277,7 +1295,7 @@
- chapter.xml
+ book.xml