note 92841 added to class.domxpath
| From: | david at lionhead dot nl | Date: | Tue, 11 Aug 2009 13:33:29 +0000 |
| Subject: | note 92841 added to class.domxpath | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159319@lists.php.net to get a copy of this message | ||
When using DOMXPath and having a default namespace. Consider using an intermediate function to add
the default namespace to all queries:
// The default namespace: x:xmlns="http://..."
$path="/Book/Title";
$path=preg_replace("\/([a-zA-Z])","/x:$1",$path);
// Result: /x:Book/x:Title
----
Server IP: 213.249.64.162
Probable Submitter: 83.232.157.250
----
Manual Page -- http://www.php.net/manual/en/class.domxpath.php
Edit -- https://master.php.net/note/edit/92841
Del: integrated -- https://master.php.net/note/delete/92841/integrated
Del: useless -- https://master.php.net/note/delete/92841/useless
Del: bad code -- https://master.php.net/note/delete/92841/bad+code
Del: spam -- https://master.php.net/note/delete/92841/spam
Del: non-english -- https://master.php.net/note/delete/92841/non-english
Del: in docs -- https://master.php.net/note/delete/92841/in+docs
Del: other reasons-- https://master.php.net/note/delete/92841
Reject -- https://master.php.net/note/reject/92841
Search -- https://master.php.net/manage/user-notes.php