Class: LibXML::XML::Schema::Element
| Relationships & Source Files | |
| Inherits: | Object |
| Defined in: | ext/libxml/ruby_xml_schema_element.c, lib/libxml/schema/element.rb |
Instance Attribute Summary
-
#array? ⇒ Boolean
readonly
Returns whether this element can appear more than once (max_occurs > 1).
- #namespace readonly
-
#required? ⇒ Boolean
readonly
Returns whether this element is required (min_occurs > 0).
- #type readonly
- #value readonly
Instance Method Summary
- #annotation
-
#elements ⇒ Hash
Returns the child elements of this element’s type.
-
#max_occurs ⇒ Integer
Returns the maximum number of times this element may appear.
-
#min_occurs ⇒ Integer
Returns the minimum number of times this element must appear.
- #node
Instance Attribute Details
#array? ⇒ Boolean (readonly)
Returns whether this element can appear more than once (max_occurs > 1).
# File 'lib/libxml/schema/element.rb', line 34
def array? max_occurs > 1 end
#namespace (readonly)
[ GitHub ]
#required? ⇒ Boolean (readonly)
Returns whether this element is required (min_occurs > 0).
# File 'lib/libxml/schema/element.rb', line 26
def required? !min_occurs.zero? end
#type (readonly)
[ GitHub ]#value (readonly)
[ GitHub ]Instance Method Details
#annotation
[ GitHub ]# File 'ext/libxml/ruby_xml_schema_element.c', line 39
static VALUE rxml_schema_element_annot(VALUE self)
{
xmlSchemaElementPtr xelem;
VALUE annotation = Qnil;
TypedData_Get_Struct(self, xmlSchemaElement, &rxml_schema_element_type, xelem);
if ((xelem->annot != NULL) && (xelem->annot->content != NULL))
{
xmlChar *content = xmlNodeGetContent(xelem->annot->content);
if (content)
{
annotation = rxml_new_cstr(content, NULL);
xmlFree(content);
}
}
return annotation;
}
#elements ⇒ Hash
Returns the child elements of this element’s type.
# File 'lib/libxml/schema/element.rb', line 42
def elements type.elements end
#max_occurs ⇒ Integer
Returns the maximum number of times this element may appear.
# File 'lib/libxml/schema/element.rb', line 18
def max_occurs @max end
#min_occurs ⇒ Integer
Returns the minimum number of times this element must appear.
# File 'lib/libxml/schema/element.rb', line 10
def min_occurs @min end
#node
[ GitHub ]# File 'ext/libxml/ruby_xml_schema_element.c', line 30
static VALUE rxml_schema_element_node(VALUE self)
{
xmlSchemaElementPtr xelem;
TypedData_Get_Struct(self, xmlSchemaElement, &rxml_schema_element_type, xelem);
return rxml_node_wrap(xelem->node);
}