[libxml-devel] Specifying namespace on XPath?

keisuke fukuda keisukefukuda at gmail.com
Tue Nov 27 08:39:29 EST 2007


So, this should be the patch.

Index: ext/xml/ruby_xml_xpath.c
===================================================================
--- ext/xml/ruby_xml_xpath.c    (revision 218)
+++ ext/xml/ruby_xml_xpath.c    (working copy)
@@ -76,9 +76,9 @@
     }
     else {
       // tuples of prefix/uri
-      if (RARRAY(RARRAY(nslist)->ptr[i])->len == 2) {
-       rprefix = RARRAY(RARRAY(nslist)->ptr[i])->ptr[0];
-       ruri = RARRAY(RARRAY(nslist)->ptr[i])->ptr[1];
+      if (RARRAY(nslist)->len == 2) {
+       rprefix = RARRAY(nslist)->ptr[0];
+       ruri = RARRAY(nslist)->ptr[1];
        ruby_xml_xpath_context_register_namespace(xxpc, rprefix, ruri);
       } else {
        rb_raise(rb_eArgError, "nested array must be an array of
strings, prefix and href/uri");
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: xpath_ns_fix.patch.txt
Url: http://rubyforge.org/pipermail/libxml-devel/attachments/20071127/ea3fc128/attachment.txt 


More information about the libxml-devel mailing list