note 32255 deleted from function.xpath-eval by sobak

From: Date: Tue, 22 Nov 2016 03:40:37 +0000
Subject: note 32255 deleted from function.xpath-eval by sobak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-207399@lists.php.net to get a copy of this message
Note Submitter: tuxo at gmx dot net ---- PHP Version: 4.3.1 I tried out how to get a part of a xml document with the xpath functions in domxml. Try the following solution: <?php // get dom object $xmldoc = domxml_open_mem($xml); // init xpath $xpath = xpath_new_context($xmldoc); $xpresult = xpath_eval($xpath, "/root/info"); // dump all nodes directly in plain text foreach ($xpresult->nodeset as $node) { $newxml .= $node->dump_node($node); } ?> If you wanna get a new dom object of the result just add $newxmldoc = domxml_open_mem($newxml);

« previous php.notes (#207399) next »