Re: SimpleXML XPath Namespace Support
| From: | Adam Maccabee Trachtenberg | Date: | Sat, 22 Nov 2003 18:51:07 +0000 |
| Subject: | Re: SimpleXML XPath Namespace Support | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-5668@lists.php.net to get a copy of this message | ||
On Sat, 22 Nov 2003, Rob Richards wrote:
> The question I have is in simplexml_ce_register_ns. As nsmap has no specific
> scope, shouldnt all the entries be registered in the xpath context, which
> would then need to happen in simplexml_ce_xpath_search?
That's why I create a new xmlXPathNewContext inside simplexml_ce_register_ns.
+ if (!sxe->xpath) {
+ sxe->xpath = xmlXPathNewContext((xmlDocPtr) sxe->document->ptr);
+ }
This seemed easier than doing an xmlHashScan inside
simplexml_ce_xpath_search and this way we only register each namespace
once.
-adam
--
adam@trachtenberg.com