### Home Classes Methods

### In Files

- lib/nokogiri/html/element_description.rb
- lib/nokogiri/html/element_description_defaults.rb
- ext/nokogiri/html_document.c

### Parent

Object

### Methods

- ::[]
- #block?
- #default_sub_element
- #deprecated?
- #deprecated_attributes
- #description
- #empty?
- #implied_end_tag?
- #implied_start_tag?
- #inline?
- #inspect
- #name
- #optional_attributes
- #required_attributes
- #save_end_tag?
- #sub_elements
- #to_s

### Files

- CHANGELOG.ja.rdoc
- CHANGELOG.rdoc
- C_CODING_STYLE.rdoc
- Manifest.txt
- README.ja.rdoc
- README.rdoc

### Class/Module Index

Quicksearch

- Nokogiri
- Nokogiri::CSS
- Nokogiri::CSS::Node
- Nokogiri::CSS::Parser
- Nokogiri::CSS::SyntaxError
- Nokogiri::CSS::Tokenizer
- Nokogiri::CSS::Tokenizer::ScanError
- Nokogiri::Decorators
- Nokogiri::Decorators::Slop
- Nokogiri::EncodingHandler
- Nokogiri::HTML
- Nokogiri::HTML::Builder
- Nokogiri::HTML::Document
- Nokogiri::HTML::Document::EncodingReader
- Nokogiri::HTML::Document::EncodingReader::JumpSAXHandler
- Nokogiri::HTML::DocumentFragment
- Nokogiri::HTML::ElementDescription
- Nokogiri::HTML::EntityDescription
- Nokogiri::HTML::EntityLookup
- Nokogiri::HTML::SAX
- Nokogiri::HTML::SAX::Parser
- Nokogiri::HTML::SAX::ParserContext
- Nokogiri::HTML::SAX::PushParser
- Nokogiri::SyntaxError
- Nokogiri::XML
- Nokogiri::XML::Attr
- Nokogiri::XML::AttributeDecl
- Nokogiri::XML::Builder
- Nokogiri::XML::CDATA
- Nokogiri::XML::CharacterData
- Nokogiri::XML::Comment
- Nokogiri::XML::DTD
- Nokogiri::XML::Document
- Nokogiri::XML::DocumentFragment
- Nokogiri::XML::Element
- Nokogiri::XML::ElementContent
- Nokogiri::XML::ElementDecl
- Nokogiri::XML::EntityDecl
- Nokogiri::XML::EntityReference
- Nokogiri::XML::Namespace
- Nokogiri::XML::Node
- Nokogiri::XML::Node::SaveOptions
- Nokogiri::XML::NodeSet
- Nokogiri::XML::Notation
- Nokogiri::XML::PP
- Nokogiri::XML::PP::CharacterData
- Nokogiri::XML::PP::Node
- Nokogiri::XML::ParseOptions
- Nokogiri::XML::ProcessingInstruction
- Nokogiri::XML::Reader
- Nokogiri::XML::RelaxNG
- Nokogiri::XML::SAX
- Nokogiri::XML::SAX::Document
- Nokogiri::XML::SAX::Parser
- Nokogiri::XML::SAX::Parser::Attribute
- Nokogiri::XML::SAX::ParserContext
- Nokogiri::XML::SAX::PushParser
- Nokogiri::XML::Schema
- Nokogiri::XML::SyntaxError
- Nokogiri::XML::Text
- Nokogiri::XML::XPath
- Nokogiri::XML::XPath::SyntaxError
- Nokogiri::XML::XPathContext
- Nokogiri::XSLT
- Nokogiri::XSLT::Stylesheet
- XSD
- XSD::XMLParser
- XSD::XMLParser::Nokogiri
- Object

No matching classes.

# Nokogiri::HTML::ElementDescription

### Constants

ACTION_ATTR
ALIGN_ATTR
ALT_ATTR
APPLET_ATTRS
AREA_ATTRS
ATTRS
A_ATTRS
BASEFONT_ATTRS
BGCOLOR_ATTR
BLOCK
BLOCKLI_ELT
BODY_ATTRS
BODY_CONTENTS
BODY_DEPR
BUTTON_ATTRS
CELLHALIGN
CELLVALIGN
CLEAR_ATTRS
COL_ATTRS
COL_ELT
COMPACT_ATTR
COMPACT_ATTRS
CONTENT_ATTR
COREATTRS
CORE_ATTRS
CORE_I18N_ATTRS
DIR_ATTR
DL_CONTENTS
DefaultDescriptions

  This is filled in down below.

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.

EDIT_ATTRS
EMBED_ATTRS
EMPTY
EVENTS
FIELDSET_CONTENTS
FLOW
FLOW_PARAM
FONTSTYLE

  Attributes defined and categorized

FONT_ATTRS
FORMCTRL
FORM_ATTRS
FORM_CONTENTS
FRAMESET_ATTRS
FRAMESET_CONTENTS
FRAME_ATTRS
HEADING
HEAD_ATTRS
HEAD_CONTENTS
HREF_ATTRS
HR_DEPR
HTML_ATTRS
HTML_CDATA
HTML_CONTENT
HTML_FLOW
HTML_INLINE
HTML_PCDATA
I18N
I18N_ATTRS
IFRAME_ATTRS
IMG_ATTRS
INLINE
INLINE_P
INPUT_ATTRS
LABEL_ATTR
LABEL_ATTRS
LANGUAGE_ATTR
LEGEND_ATTRS
LINK_ATTRS
LIST
LI_ELT
MAP_CONTENTS
META_ATTRS
MODIFIER
NAME_ATTR
NOFRAMES_CONTENT
OBJECT_ATTRS
OBJECT_CONTENTS
OBJECT_DEPR
OL_ATTRS
OPTGROUP_ATTRS
OPTION_ATTRS
OPTION_ELT
PARAM_ATTRS
PCDATA
PHRASE
PRE_CONTENT
PROMPT_ATTRS
QUOTE_ATTRS
ROWS_COLS_ATTR
SCRIPT_ATTRS
SELECT_ATTRS
SELECT_CONTENT
SPECIAL
SRC_ALT_ATTRS
STYLE_ATTRS
TABLE_ATTRS
TABLE_CONTENTS
TABLE_DEPR
TALIGN_ATTRS
TARGET_ATTR
TEXTAREA_ATTRS
TH_TD_ATTR
TH_TD_DEPR
TR_CONTENTS
TR_ELT
TYPE_ATTR
UL_DEPR
VERSION_ATTR
WIDTH_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
    def block?
      !inline?
    end

default_sub_element() click to toggle source

The default sub element for this element

    # File lib/nokogiri/html/element_description_defaults.rb, line 61
    def default_sub_element
      d = default_desc
      d ? d.defaultsubelt : nil
    end

deprecated?() click to toggle source

Is this element deprecated?

    # File lib/nokogiri/html/element_description_defaults.rb, line 47
    def deprecated?
      d = default_desc
      d ? d.depr : nil
    end

deprecated_attributes() click to toggle source

A list of deprecated attributes for this element

    # File lib/nokogiri/html/element_description_defaults.rb, line 75
    def deprecated_attributes
      d = default_desc
      d ? d.attrs_depr : []
    end

description() click to toggle source

The description for this element

    # File lib/nokogiri/html/element_description_defaults.rb, line 54
    def description
      d = default_desc
      d ? d.desc : nil
    end

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

Can the end tag be implied for this tag?

    # File lib/nokogiri/html/element_description_defaults.rb, line 33
    def implied_end_tag?
      d = default_desc
      d ? d.endTag : nil
    end

implied_start_tag?() click to toggle source

Can the start tag be implied for this tag?

    # File lib/nokogiri/html/element_description_defaults.rb, line 26
    def implied_start_tag?
      d = default_desc
      d ? d.startTag : nil
    end

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
    def inspect
      "#<#{self.class.name}: #{name} #{description}>"
    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

A list of optional attributes for this element

    # File lib/nokogiri/html/element_description_defaults.rb, line 68
    def optional_attributes
      d = default_desc
      d ? d.attrs_opt : []
    end

required_attributes() click to toggle source

A list of required attributes for this element

    # File lib/nokogiri/html/element_description_defaults.rb, line 82
    def required_attributes
      d = default_desc
      d ? d.attrs_req : []
    end

save_end_tag?() click to toggle source

Should the end tag be saved?

    # File lib/nokogiri/html/element_description_defaults.rb, line 40
    def save_end_tag?
      d = default_desc
      d ? d.saveEndTag : nil
    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
    def to_s
      "#{name}: #{description}"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.