/* * call-seq: * new(document) * * Create a new DocumentFragment element on the +document+ */ static VALUE new(VALUE klass, VALUE doc) { xmlDocPtr xml_doc; Data_Get_Struct(doc, xmlDoc, xml_doc); xmlNodePtr node = xmlNewDocFragment(xml_doc->doc); if(node->doc->children) node->ns = node->doc->children->ns; VALUE rb_node = Nokogiri_wrap_xml_node(node); if(rb_block_given_p()) rb_yield(rb_node); return rb_node; }