Skip to content

Commit 926a561

Browse files
author
Gonzalo Chumillas
committed
Update README.md
1 parent 9af9c77 commit 926a561

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,10 @@ echo $root;
9292
// creates an instance from a string
9393
$xml = DomNode::createFromString('<root><item id="101" /><item id="102" /><item id="103" /></root>');
9494

95-
// creates an instance from a document
95+
// creates an instance from a given DOMElement
9696
$doc = new DOMDocument("1.0", "UTF-8");
9797
$doc->loadXML('<root><item id="101" /><item id="102" /><item id="103" /></root>');
98-
$xml = DomNode::createFromDocument($doc);
99-
100-
// creates an instance from a given DOMElement
101-
// $element is a DOMElement object
102-
$xml = DomNode::createFromElement($element);
98+
$xml = DomNode::createFromElement($doc->documentElement);
10399
```
104100

105101
#### Use the `query` method

0 commit comments

Comments
 (0)