Esempio n. 1
0
    public function testNS()
    {
        $root = new SimpleDOM('<root>
				<ns:child1 xmlns:ns="urn:ns">
					<ns:grandchild1 />
				</ns:child1>
				<child2 />
				<child3 />
			</root>', LIBXML_NOBLANKS);
        $expected = '<root>
				<ns:child1 xmlns:ns="urn:ns" />
				<child2>
					<ns:grandchild1 xmlns:ns="urn:ns" moved="1" />
				</child2>
				<child3 />
			</root>';
        $nodes = $root->children('urn:ns');
        $node = $nodes[0]->grandchild1;
        $return = $node->moveTo($root->child2);
        $return['moved'] = 1;
        $this->assertXmlStringEqualsXmlString($expected, $root->asXML());
    }