[ create a new paste ] login | about

Link: http://codepad.org/yCFegZbp    [ raw code | output | fork ]

PHP, pasted on May 5:
1
2
3
4
5
6
7
8
9
10
11
<?php
$dom = new DomDocument();
$dom->loadXml('<root attr1="a" attr2="b"><foo></foo></root>');

$dom2 = new DomDocument();
$dom2->appendChild(
	$dom2->importNode($dom->documentElement->cloneNode(false), true) 
);

header('Content-Type: text/xml; charset="UTF-8"');
echo $dom2->saveXml();


Output:
1
2
<?xml version="1.0"?>
<root attr1="a" attr2="b"/>


Create a new paste based on this one


Comments: