|
DOMDocument::importNodeImport node into current document Description
public DOMNode DOMDocument::importNode
( DOMNode
$importedNode
[, bool $deep
] )This function returns a copy of the node to import and associates it with the current document. Parameters
Return Values
The copied node or Errors/ExceptionsDOMException is thrown if node cannot be imported. Examples
Example #1 DOMDocument::importNode example Copying nodes between documents.
<?php The above example will output: The 'new document' before copying nodes into it: <?xml version="1.0"?> <root> <someelement>text in some element</someelement> </root> The 'new document' after copying the nodes into it: <?xml version="1.0"?> <root> <someelement>text in some element</someelement> <element> <child>text in child</child> </element> </root> |