Class: Nokogiri::XML::ElementDecl

Inherits:
Node
  • Object
show all
Defined in:
lib/nokogiri/xml/element_decl.rb,
ext/nokogiri/xml_element_decl.c

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Nokogiri::XML::Node

Instance Method Details

#contentObject

The allowed content for this ElementDecl



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'ext/nokogiri/xml_element_decl.c', line 27

static VALUE
content(VALUE self)
{
  xmlElementPtr node;
  Data_Get_Struct(self, xmlElement, node);

  if (!node->content) { return Qnil; }

  return noko_xml_element_content_wrap(
           rb_funcall(self, id_document, 0),
           node->content
         );
}

#element_typeObject

The element_type



13
14
15
16
17
18
19
# File 'ext/nokogiri/xml_element_decl.c', line 13

static VALUE
element_type(VALUE self)
{
  xmlElementPtr node;
  Data_Get_Struct(self, xmlElement, node);
  return INT2NUM((long)node->etype);
}

#inspectObject



9
10
11
# File 'lib/nokogiri/xml/element_decl.rb', line 9

def inspect
  "#<#{self.class.name}:#{sprintf("0x%x", object_id)} #{to_s.inspect}>"
end

#prefixObject

The namespace prefix for this ElementDecl



47
48
49
50
51
52
53
54
55
56
# File 'ext/nokogiri/xml_element_decl.c', line 47

static VALUE
prefix(VALUE self)
{
  xmlElementPtr node;
  Data_Get_Struct(self, xmlElement, node);

  if (!node->prefix) { return Qnil; }

  return NOKOGIRI_STR_NEW2(node->prefix);
}