use DOMElement;
use DOMNode;
use DOMNodeList;
+use DOMText;
use DOMXPath;
/**
return $element;
}
+ /**
+ * Create a new text node within this document.
+ */
+ public function createTextNode(string $text): DOMText
+ {
+ return $this->document->createTextNode($text);
+ }
+
/**
* Get an element within the document of the given ID.
*/
{
return $this->document->saveHTML($node);
}
-
- /**
- * Adopt the given nodes into this document.
- * @param DOMNode[] $nodes
- * @return DOMNode[]
- */
- public function adoptNodes(array $nodes): array
- {
- $adopted = [];
- foreach ($nodes as $node) {
- $adopted[] = $this->document->importNode($node, true);
- }
-
- return $adopted;
- }
}