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



24
25
26
27
28
29
30
31
32
33
34
35
# File 'ext/nokogiri/xml_element_decl.c', line 24

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

  if(!node->content) return Qnil;

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

#element_typeObject

The element_type



11
12
13
14
15
16
# File 'ext/nokogiri/xml_element_decl.c', line 11

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



43
44
45
46
47
48
49
50
51
# File 'ext/nokogiri/xml_element_decl.c', line 43

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

  if(!node->prefix) return Qnil;

  return NOKOGIRI_STR_NEW2(node->prefix);
}