Parent

Class Index [+]

Quicksearch

Nokogiri::HTML::ElementDescription

Constants

Desc

Methods are defined protected by method_defined? because at this point the C-library or Java library is already loaded, and we don’t want to clobber any methods that have been defined there.

DefaultDescriptions

This is filled in down below.

FONTSTYLE

Attributes defined and categorized

PHRASE
SPECIAL
PCDATA
HEADING
LIST
FORMCTRL
BLOCK
INLINE
FLOW
MODIFIER
EMPTY
HTML_FLOW
HTML_INLINE
HTML_PCDATA
HTML_CDATA
COREATTRS
I18N
EVENTS
ATTRS
CELLHALIGN
CELLVALIGN
HTML_ATTRS
CORE_I18N_ATTRS
CORE_ATTRS
I18N_ATTRS
A_ATTRS
TARGET_ATTR
ROWS_COLS_ATTR
ALT_ATTR
SRC_ALT_ATTRS
HREF_ATTRS
CLEAR_ATTRS
INLINE_P
FLOW_PARAM
APPLET_ATTRS
AREA_ATTRS
BASEFONT_ATTRS
QUOTE_ATTRS
BODY_CONTENTS
BODY_ATTRS
BODY_DEPR
BUTTON_ATTRS
COL_ATTRS
COL_ELT
EDIT_ATTRS
COMPACT_ATTRS
DL_CONTENTS
COMPACT_ATTR
LABEL_ATTR
FIELDSET_CONTENTS
FONT_ATTRS
FORM_CONTENTS
FORM_ATTRS
FRAME_ATTRS
FRAMESET_ATTRS
FRAMESET_CONTENTS
HEAD_ATTRS
HEAD_CONTENTS
HR_DEPR
VERSION_ATTR
HTML_CONTENT
IFRAME_ATTRS
IMG_ATTRS
EMBED_ATTRS
INPUT_ATTRS
PROMPT_ATTRS
LABEL_ATTRS
LEGEND_ATTRS
ALIGN_ATTR
LINK_ATTRS
MAP_CONTENTS
NAME_ATTR
ACTION_ATTR
BLOCKLI_ELT
META_ATTRS
CONTENT_ATTR
TYPE_ATTR
NOFRAMES_CONTENT
OBJECT_CONTENTS
OBJECT_ATTRS
OBJECT_DEPR
OL_ATTRS
OPTION_ELT
OPTGROUP_ATTRS
OPTION_ATTRS
PARAM_ATTRS
WIDTH_ATTR
PRE_CONTENT
SCRIPT_ATTRS
LANGUAGE_ATTR
SELECT_CONTENT
SELECT_ATTRS
STYLE_ATTRS
TABLE_ATTRS
TABLE_DEPR
TABLE_CONTENTS
TR_ELT
TALIGN_ATTRS
TH_TD_DEPR
TH_TD_ATTR
TEXTAREA_ATTRS
TR_CONTENTS
BGCOLOR_ATTR
LI_ELT
UL_DEPR
DIR_ATTR

Public Class Methods

[](tag_name) click to toggle source

Get ElemementDescription for tag_name

static VALUE get_description(VALUE klass, VALUE tag_name)
{
  const htmlElemDesc * description = htmlTagLookup(
      (const xmlChar *)StringValuePtr(tag_name)
  );

  if(NULL == description) return Qnil;
  return Data_Wrap_Struct(klass, 0, 0, (void *)description);
}

Public Instance Methods

block?() click to toggle source
 

Is this element a block element?

   # File lib/nokogiri/html/element_description.rb, line 6
6:       def block?
7:         !inline?
8:       end
default_sub_element click to toggle source

The default sub element for this element

static VALUE default_sub_element(VALUE self)
{
  htmlElemDesc * description;
  Data_Get_Struct(self, htmlElemDesc, description);

  return NOKOGIRI_STR_NEW2(description->defaultsubelt);
}
default_sub_element() click to toggle source
    # File lib/nokogiri/html/element_description_defaults.rb, line 61
61:         def default_sub_element
62:           d = default_desc
63:           d ? d.defaultsubelt : nil
64:         end
deprecated?() click to toggle source
    # File lib/nokogiri/html/element_description_defaults.rb, line 47
47:         def deprecated?
48:           d = default_desc
49:           d ? d.depr : nil
50:         end
deprecated? click to toggle source

Is this element deprecated?

static VALUE deprecated_eh(VALUE self)
{
  htmlElemDesc * description;
  Data_Get_Struct(self, htmlElemDesc, description);

  if(description->depr) return Qtrue;
  return Qfalse;
}
deprecated_attributes click to toggle source

A list of deprecated attributes for this element

static VALUE deprecated_attributes(VALUE self)
{
  htmlElemDesc * description;
  VALUE list;
  int i;

  Data_Get_Struct(self, htmlElemDesc, description);

  list = rb_ary_new();

  if(NULL == description->attrs_depr) return list;

  for(i = 0; description->attrs_depr[i]; i++) {
    rb_ary_push(list, NOKOGIRI_STR_NEW2(description->attrs_depr[i]));
  }

  return list;
}
deprecated_attributes() click to toggle source
    # File lib/nokogiri/html/element_description_defaults.rb, line 75
75:         def deprecated_attributes
76:           d = default_desc
77:           d ? d.attrs_depr : []
78:         end
description() click to toggle source
    # File lib/nokogiri/html/element_description_defaults.rb, line 54
54:         def description
55:           d = default_desc
56:           d ? d.desc : nil
57:         end
description click to toggle source

The description for this element

static VALUE description(VALUE self)
{
  htmlElemDesc * description;
  Data_Get_Struct(self, htmlElemDesc, description);

  return NOKOGIRI_STR_NEW2(description->desc);
}
empty? click to toggle source

Is this an empty element?

static VALUE empty_eh(VALUE self)
{
  htmlElemDesc * description;
  Data_Get_Struct(self, htmlElemDesc, description);

  if(description->empty) return Qtrue;
  return Qfalse;
}
implied_end_tag?() click to toggle source
    # File lib/nokogiri/html/element_description_defaults.rb, line 33
33:         def implied_end_tag?
34:           d = default_desc
35:           d ? d.endTag : nil
36:         end
implied_end_tag? click to toggle source

Can the end tag be implied for this tag?

static VALUE implied_end_tag_eh(VALUE self)
{
  htmlElemDesc * description;
  Data_Get_Struct(self, htmlElemDesc, description);

  if(description->endTag) return Qtrue;
  return Qfalse;
}
implied_start_tag?() click to toggle source
    # File lib/nokogiri/html/element_description_defaults.rb, line 26
26:         def implied_start_tag?
27:           d = default_desc
28:           d ? d.startTag : nil
29:         end
implied_start_tag? click to toggle source

Can the start tag be implied for this tag?

static VALUE implied_start_tag_eh(VALUE self)
{
  htmlElemDesc * description;
  Data_Get_Struct(self, htmlElemDesc, description);

  if(description->startTag) return Qtrue;
  return Qfalse;
}
inline? click to toggle source

Is this element an inline element?

static VALUE inline_eh(VALUE self)
{
  htmlElemDesc * description;
  Data_Get_Struct(self, htmlElemDesc, description);

  if(description->isinline) return Qtrue;
  return Qfalse;
}
inspect() click to toggle source
 

Inspection information

    # File lib/nokogiri/html/element_description.rb, line 18
18:       def inspect
19:         "#<#{self.class.name}: #{name} #{description}>"
20:       end
name click to toggle source

Get the tag name for this ElemementDescription

static VALUE name(VALUE self)
{
  htmlElemDesc * description;
  Data_Get_Struct(self, htmlElemDesc, description);

  if(NULL == description->name) return Qnil;
  return NOKOGIRI_STR_NEW2(description->name);
}
optional_attributes() click to toggle source
    # File lib/nokogiri/html/element_description_defaults.rb, line 68
68:         def optional_attributes
69:           d = default_desc
70:           d ? d.attrs_opt : []
71:         end
optional_attributes click to toggle source

A list of optional attributes for this element

static VALUE optional_attributes(VALUE self)
{
  htmlElemDesc * description;
  VALUE list;
  int i;

  Data_Get_Struct(self, htmlElemDesc, description);

  list = rb_ary_new();

  if(NULL == description->attrs_opt) return list;

  for(i = 0; description->attrs_opt[i]; i++) {
    rb_ary_push(list, NOKOGIRI_STR_NEW2(description->attrs_opt[i]));
  }

  return list;
}
required_attributes() click to toggle source
    # File lib/nokogiri/html/element_description_defaults.rb, line 82
82:         def required_attributes
83:           d = default_desc
84:           d ? d.attrs_req : []
85:         end
required_attributes click to toggle source

A list of required attributes for this element

static VALUE required_attributes(VALUE self)
{
  htmlElemDesc * description;
  VALUE list;
  int i;

  Data_Get_Struct(self, htmlElemDesc, description);

  list = rb_ary_new();

  if(NULL == description->attrs_req) return list;

  for(i = 0; description->attrs_depr[i]; i++) {
    rb_ary_push(list, NOKOGIRI_STR_NEW2(description->attrs_req[i]));
  }

  return list;
}
save_end_tag? click to toggle source

Should the end tag be saved?

static VALUE save_end_tag_eh(VALUE self)
{
  htmlElemDesc * description;
  Data_Get_Struct(self, htmlElemDesc, description);

  if(description->saveEndTag) return Qtrue;
  return Qfalse;
}
save_end_tag?() click to toggle source
    # File lib/nokogiri/html/element_description_defaults.rb, line 40
40:         def save_end_tag?
41:           d = default_desc
42:           d ? d.saveEndTag : nil
43:         end
sub_elements click to toggle source

A list of allowed sub elements for this element.

static VALUE sub_elements(VALUE self)
{
  htmlElemDesc * description;
  VALUE list;
  int i;

  Data_Get_Struct(self, htmlElemDesc, description);

  list = rb_ary_new();

  if(NULL == description->subelts) return list;

  for(i = 0; description->subelts[i]; i++) {
    rb_ary_push(list, NOKOGIRI_STR_NEW2(description->subelts[i]));
  }

  return list;
}
to_s() click to toggle source
 

Convert this description to a string

    # File lib/nokogiri/html/element_description.rb, line 12
12:       def to_s
13:         "#{name}: #{description}"
14:       end

Private Instance Methods

default_desc() click to toggle source
    # File lib/nokogiri/html/element_description_defaults.rb, line 20
20:       def default_desc
21:         DefaultDescriptions[name.downcase]
22:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.