/* * call-seq: * new(document, name, content) * * Create a new ProcessingInstruction element on the +document+ with +name+ * and +content+ */ static VALUE new(VALUE klass, VALUE doc, VALUE name, VALUE content) { xmlDocPtr xml_doc; Data_Get_Struct(doc, xmlDoc, xml_doc); xmlNodePtr node = xmlNewDocPI( xml_doc, (const xmlChar *)StringValuePtr(name), (const xmlChar *)StringValuePtr(content) ); VALUE rb_node = Nokogiri_wrap_xml_node(node); if(rb_block_given_p()) rb_yield(rb_node); return rb_node; }