When you left out the second argument or enter false, not only the child nodes are ommited. The attributes of the node are also cut off.
![]() |
|
||||||||||
|
DOMDocument->importNode()(no version information, might be only in CVS) DOMDocument->importNode() -- Import node into current documentОписаниеclass DOMDocument {DOMNode importNode ( DOMNode importedNode [, bool deep] ) } This function returns a copy of the node to import and associates it with the current document. Список параметров
DOMDocument->importNode()
mark at 4inloop dot de
05-Apr-2007 05:51
When you left out the second argument or enter false, not only the child nodes are ommited. The attributes of the node are also cut off.
adjwilli
05-Oct-2006 01:08
Editing XML with PHP can be a pain in the Secretary of State Powell, so here's a script to replace an XML node with a user-provided one through the POST. It's usually a good idea to run the $_POST['xml'] through a validation check and clean it for other thing before running this.
stomas
19-Sep-2006 06:14
I think this should do the same:
Colin
12-Sep-2006 09:11
As of PHP 5.1.6 with libxml 2.6.26 and DOM/XML API version 20031129, importNode() does nothing if attempting to import from the same document. Meaning, if you do an $ret = importNode and then appendChild($ret) or insertBefore($ret, ...) then you will end up *moving* the node instead of ending up with a copy.
andy dot clark at dial dot pipex dot com
15-Aug-2006 08:20
One useful use of importNode is to copy one node onto another.
Fitopaldi
03-Aug-2005 11:29
importNode returns a copy of the node to import and associates it with the current document, but not import the node to the current DOMDocument. Use appendChild for import the copy of the node to current DOMDocument. |