Re: [PHP-DEV] SimpleXML XPath Namespace Support

2003-11-24 Thread Rob Richards
From: Adam Maccabee Trachtenberg > Ah. I see. Okay, I've prepared a modified patch that defers namespace > registration until the call to simplexml_ce_xpath_search(). Inside > that function, I iterate through the nsmapptr->nsmap hash and register > all the namespaces. Thanks, patch applied. Rob

Re: [PHP-DEV] SimpleXML XPath Namespace Support

2003-11-23 Thread Adam Maccabee Trachtenberg
On Sat, 22 Nov 2003, Rob Richards wrote: > 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 Ah. I see. Okay, I've prepared a modified patch that defers n

Re: [PHP-DEV] SimpleXML XPath Namespace Support

2003-11-22 Thread 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_n

Re: [PHP-DEV] SimpleXML XPath Namespace Support

2003-11-22 Thread Adam Maccabee Trachtenberg
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 xmlXPathNewContex

Re: [PHP-DEV] SimpleXML XPath Namespace Support

2003-11-22 Thread Rob Richards
From: Adam Maccabee Trachtenberg > http://www.trachtenberg.com/patches/simplexml_xpath_ns_patch.txt > > Can someone with SimpleXML karma please review and apply. See Bug > #26159 for more information. The question I have is in simplexml_ce_register_ns. As nsmap has no specific scope, shouldnt all

[PHP-DEV] SimpleXML XPath Namespace Support

2003-11-21 Thread Adam Maccabee Trachtenberg
SimpleXML's XPath searching doesn't allow you to use namespaces. This patch: 1) Automatically registers any namespace prefixes used in the document. 2) Registers any prefixes manually added from calls registerNS(). 3) Lets you refer to Qualified Names using the standard Prefix:LocalPart synt