Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5670 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69151 invoked by uid 1010); 22 Nov 2003 22:42:36 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 69124 invoked from network); 22 Nov 2003 22:42:36 -0000 Received: from unknown (HELO phoebe.host4u.net) (209.150.128.26) by pb1.pair.com with SMTP; 22 Nov 2003 22:42:36 -0000 Received: from ctdprimary (dsta-aa203.pivot.net [66.186.171.203]) by phoebe.host4u.net (8.11.6/8.11.6) with SMTP id hAMMg5m28365; Sat, 22 Nov 2003 16:42:05 -0600 Message-ID: <008801c3b14a$10105d30$f7dea8c0@cyberware.local> To: "Adam Maccabee Trachtenberg" Cc: References: <027c01c3b105$44a93ac0$f7dea8c0@cyberware.local> Date: Sat, 22 Nov 2003 17:43:34 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Subject: Re: [PHP-DEV] SimpleXML XPath Namespace Support From: rrichards@ctindustries.net ("Rob Richards") From: Adam Maccabee Trachtenberg > That's why I create a new xmlXPathNewContext inside simplexml_ce_register_ns. > > + if (!sxe->xpath) { > + sxe->xpath = xmlXPathNewContext((xmlDocPtr) sxe->document->ptr); > + } But xpath isn't shared across the objects, so calling simplexml_ce_register_ns with different sxe objects will result in multiple XPath contexts each having their own registered namespaces (by registered namespaces I refer to ones the user adds via the register_ns call) and depending upon which object is used to search with (it may even be one which wasnt used with a register_ns call), would then determe which ones are used. I am not sure if this is the correct behavior as it seems that all the namesapces from nsmap should be used for the query. Rob