Sha256: 972cb7bc9e38dc588972c993a4097400552f92fa140c43903dfebe712eb027b1

Contents?: true

Size: 1.07 KB

Versions: 261

Compression:

Stored size: 1.07 KB

Contents

#include <nokogiri.h>

VALUE cNokogiriXmlEntityReference;

/*
 * call-seq:
 *  new(document, content)
 *
 * Create a new EntityReference element on the +document+ with +name+
 */
static VALUE
new (int argc, VALUE *argv, VALUE klass)
{
  xmlDocPtr xml_doc;
  xmlNodePtr node;
  VALUE document;
  VALUE name;
  VALUE rest;
  VALUE rb_node;

  rb_scan_args(argc, argv, "2*", &document, &name, &rest);

  xml_doc = noko_xml_document_unwrap(document);

  node = xmlNewReference(
           xml_doc,
           (const xmlChar *)StringValueCStr(name)
         );

  noko_xml_document_pin_node(node);

  rb_node = noko_xml_node_wrap(klass, node);
  rb_obj_call_init(rb_node, argc, argv);

  if (rb_block_given_p()) { rb_yield(rb_node); }

  return rb_node;
}

void
noko_init_xml_entity_reference(void)
{
  assert(cNokogiriXmlNode);
  /*
   * EntityReference represents an EntityReference node in an xml document.
   */
  cNokogiriXmlEntityReference = rb_define_class_under(mNokogiriXml, "EntityReference", cNokogiriXmlNode);

  rb_define_singleton_method(cNokogiriXmlEntityReference, "new", new, -1);
}

Version data entries

261 entries across 261 versions & 7 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/nokogiri-1.16.6-arm64-darwin/ext/nokogiri/xml_entity_reference.c
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/nokogiri-1.16.5-x86_64-linux/ext/nokogiri/xml_entity_reference.c
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/nokogiri-1.16.5-x86_64-linux/ext/nokogiri/xml_entity_reference.c
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/nokogiri-1.16.5-x86_64-linux/ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.6 ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.6-x86_64-linux ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.6-x86_64-darwin ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.6-x86-mingw32 ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.6-x86-linux ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.6-x64-mingw32 ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.6-x64-mingw-ucrt ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.6-java ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.6-arm64-darwin ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.6-arm-linux ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.6-aarch64-linux ext/nokogiri/xml_entity_reference.c
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/nokogiri-1.16.5-x86_64-linux/ext/nokogiri/xml_entity_reference.c
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/nokogiri-1.16.5-x86_64-linux/ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.4 ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.4-x86_64-linux ext/nokogiri/xml_entity_reference.c
nokogiri-1.16.4-x86_64-darwin ext/nokogiri/xml_entity_reference.c