/* * call-seq: * new(node) * * Create a new XPathContext with +node+ as the reference point. */ static VALUE new(VALUE klass, VALUE nodeobj) { xmlNodePtr node; xmlXPathContextPtr ctx; VALUE self; xmlXPathInit(); Data_Get_Struct(nodeobj, xmlNode, node); ctx = xmlXPathNewContext(node->doc); ctx->node = node; self = Data_Wrap_Struct(klass, 0, deallocate, ctx); /*rb_iv_set(self, "@xpath_handler", Qnil); */ return self; }