Re: DomXPath extension
| From: | Christian Stocker | Date: | Sat, 24 Jul 2004 16:46:40 +0000 |
| Subject: | Re: DomXPath extension | ||
| References: | 1 2 3 4 5 6 | Groups: | php.xml.dev |
| Request: | Send a blank email to php-xml-dev+get-433@lists.php.net to get a copy of this message | ||
On 24.7.2004 17:43 Uhr, Adam Maccabee Trachtenberg wrote:
On Sat, 24 Jul 2004, Jason Barnett wrote:... depending on the 3rd optional argument $type ;) Look also at the xsl_ext_function_php function in ext/xsl/xsltprocessor.c In there, we convert different xpath results-types to different PHP types with the help of libxml2 cast functions and ZendEngine macros If you're stuck somewhere, just ask here again (or on internals@ if it's a common php extension question) And if you have a working implementation (doesn't have to perfect or complete), just send the patch here (or a link to it) and we will have a look at it Have fun. chregu -- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | chregu@bitflux.ch | gnupg-keyid 0x5CE1DECBTo be honest I've never written any extensions or PHP source before so this will be fun to try, but obviously whatever I come up with is not going to be optimal. But I want to see this get done so I'll give it my best shot... and let you all make suggestions or just improve it yourselves.I looked at the source code last night and it doesn't look too tough. The hardest part is also groking the libxml2 functions. However, all I think you really need to do is take the original query() method and modify the part that grabs the results from libxml2 and turns it into a string or number instead of a DOMNodeList.