Class: Nokogiri::XML::CData
- Inherits:
-
NokogiriXmlNode
- Object
- NokogiriXmlNode
- Nokogiri::XML::CData
- Defined in:
- ext/nokogiri/xml_cdata.c
Class Method Summary collapse
-
.new(document, content) ⇒ Object
Create a new CData element on the
documentwithcontent.
Class Method Details
.new(document, content) ⇒ Object
Create a new CData element on the document with content
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'ext/nokogiri/xml_cdata.c', line 18 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), NUM2INT(rb_funcall(content, rb_intern("length"), 0)) ); VALUE rb_node = Data_Wrap_Struct(klass, NULL, dealloc, node); node->_private = (void *)rb_node; if(rb_block_given_p()) rb_yield(rb_node); return rb_node; } |