Class: Nokogiri::XML::ElementContent
- Inherits:
-
Object
- Object
- Nokogiri::XML::ElementContent
- Defined in:
- lib/nokogiri/xml/element_content.rb,
ext/nokogiri/xml_element_content.c
Overview
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 <!ELEMENT> tag shown above that lists the possible content for the div1 tag.
Constant Summary collapse
- PCDATA =
Possible definitions of type
1
- ELEMENT =
2
- SEQ =
3
- OR =
4
- ONCE =
Possible content occurrences
1
- OPT =
2
- MULT =
3
- PLUS =
4
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
Instance Method Summary collapse
-
#children ⇒ Object
Get the children of this ElementContent node.
-
#name ⇒ Object
Get the require element
name
. -
#occur ⇒ Object
Get the element content
occur
flag. -
#prefix ⇒ Object
Get the element content namespace
prefix
. -
#type ⇒ Object
Get the element content
type
.
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
28 29 30 |
# File 'lib/nokogiri/xml/element_content.rb', line 28 def document @document end |
Instance Method Details
#children ⇒ Object
Get the children of this ElementContent node
32 33 34 |
# File 'lib/nokogiri/xml/element_content.rb', line 32 def children [c1, c2].compact end |
#name ⇒ Object
Get the require element name
11 12 13 14 15 16 17 18 |
# File 'ext/nokogiri/xml_element_content.c', line 11
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 ⇒ Object
Get the element content occur
flag. Possible values are ONCE, OPT, MULT or PLUS.
72 73 74 75 76 77 78 |
# File 'ext/nokogiri/xml_element_content.c', line 72
static VALUE get_occur(VALUE self)
{
xmlElementContentPtr elem;
Data_Get_Struct(self, xmlElementContent, elem);
return INT2NUM((long)elem->ocur);
}
|
#prefix ⇒ Object
Get the element content namespace prefix
.
86 87 88 89 90 91 92 93 94 |
# File 'ext/nokogiri/xml_element_content.c', line 86
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 ⇒ Object
Get the element content type
. Possible values are PCDATA, ELEMENT, SEQ, or OR.
27 28 29 30 31 32 33 |
# File 'ext/nokogiri/xml_element_content.c', line 27
static VALUE get_type(VALUE self)
{
xmlElementContentPtr elem;
Data_Get_Struct(self, xmlElementContent, elem);
return INT2NUM((long)elem->type);
}
|