note 92668 added to function.simplexml-element-xpath

From: Date: Mon, 03 Aug 2009 13:52:35 +0000
Subject: note 92668 added to function.simplexml-element-xpath
Groups: php.notes 
Request: Send a blank email to php-notes+get-159028@lists.php.net to get a copy of this message
To fix Glenn Schmidt's noted behaviour that the parent elements are searched even if your context is a child element, you can run the child element through something such as: <?php // ... set $result to contain a SimpleXML object $result = simplexml_load_string($result->asXML()); $result->xpath('/your/query/'); ?> Which will destroy any parental references. If you rely on them, then this way will not alleviate the issue. ---- Server IP: 117.55.229.1 Probable Submitter: 2002:3aa1:946:0:223:6cff:fe83:7035 ---- Manual Page -- http://www.php.net/manual/en/function.simplexml-element-xpath.php Edit -- https://master.php.net/note/edit/92668 Del: integrated -- https://master.php.net/note/delete/92668/integrated Del: useless -- https://master.php.net/note/delete/92668/useless Del: bad code -- https://master.php.net/note/delete/92668/bad+code Del: spam -- https://master.php.net/note/delete/92668/spam Del: non-english -- https://master.php.net/note/delete/92668/non-english Del: in docs -- https://master.php.net/note/delete/92668/in+docs Del: other reasons-- https://master.php.net/note/delete/92668 Reject -- https://master.php.net/note/reject/92668 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#159028) next »