DOMElement cloning and appending: 'Wrong Document Error'

后端 未结 2 1893
我在风中等你
我在风中等你 2020-12-17 07:47

There\'s something I don\'t fully understand about node cloning with the PHP\'s DOM api. Here\'s a sample file that quickly duplicates the issue I\'m coming across.

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-17 08:35

    Use DOMDocument->importNode to import the node into the other document before adding it to the DOM.

提交回复
热议问题