Install
sudo gem install nokogiri
Contribute
github.com/tenderlove/nokogiri

An HTML, XML, SAX, & Reader parser with the ability to search documents via XPath or CSS3 selectors… and much more

Nokogiri

Class Nokogiri::XML::ElementContent inherits from Object

 

Represents the allowed content in an Element Declaration inside a DTD:

<?xml version="1.0"?><?TEST-STYLE PIDATA?>
<!DOCTYPE staff SYSTEM "staff.dtd" [
   <!ELEMENT div1 (head, (p | list | note)*, div2*)>
]>
</root>

ElementContent represents the tree inside the tag shown above that lists the possible content for the div1 tag.

Constants

ELEMENT
MULT
ONCE

Possible content occurrences

OPT
OR
PCDATA

Possible definitions of type

PLUS
SEQ

Attributes

document R

Public Instance Methods

children() Show Source
 

Get the children of this ElementContent node

# File lib/nokogiri/xml/element_content.rb, line 31 31: def children 32: [c1, c2].compact 33: end
name() Show Source

Get the require element name

static VALUE get_name(VALUE self) { xmlElementContentPtr elem; Data_Get_Struct(self, xmlElementContent, elem); if(!elem->name) return Qnil; return NOKOGIRI_STR_NEW2(elem->name); }
occur() Show Source

Get the element content occur flag. Possible values are ONCE, OPT, MULT or PLUS.

static VALUE get_occur(VALUE self) { xmlElementContentPtr elem; Data_Get_Struct(self, xmlElementContent, elem); return INT2NUM((long)elem->ocur); }
prefix() Show Source

Get the element content namespace prefix.

static VALUE get_prefix(VALUE self) { xmlElementContentPtr elem; Data_Get_Struct(self, xmlElementContent, elem); if(!elem->prefix) return Qnil; return NOKOGIRI_STR_NEW2(elem->prefix); }
type() Show Source

Get the element content type. Possible values are PCDATA, ELEMENT, SEQ, or OR.

static VALUE get_type(VALUE self) { xmlElementContentPtr elem; Data_Get_Struct(self, xmlElementContent, elem); return INT2NUM((long)elem->type); }