note 43212 added to function.dom-domxpath-query

From: Date: Mon, 14 Jun 2004 12:52:20 +0000
Subject: note 43212 added to function.dom-domxpath-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-71040@lists.php.net to get a copy of this message
Get a DOMXPath object : <?php $xmlString = ' <g id="points_topo"> <use id="points_topo_0" x="586004" y="-1466437" /> <use id="points_topo_1" x="586197" y="-1467479" /> <use id="points_topo_2" x="586664" y="-1468697" /> <use id="points_topo_3" x="584905" y="-1473660" /> <use id="points_topo_4" x="585005" y="-1469216" /> </g>'; $docSVG = new DOMDocument; $docSVG->loadXML("$xmlString"); $objectXPath = new DOMXPath($docSVG); $nodeList = $objectXPath->query("/g/use[@x > 586000]"); $i = 0; while ( $node = $nodeList->item($i) ) { echo "id = " . $node->getAttribute("id") . "<br/>\n"; $i++; } ?> ---- Manual Page -- http://www.php.net/manual/en/function.dom-domxpath-query.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43212 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43212&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43212&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#71040) next »