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