Class: LibXML::XML::Schema::Element
- Inherits:
-
Object
- Object
- LibXML::XML::Schema::Element
- Defined in:
- lib/libxml/schema/element.rb,
ext/libxml/ruby_xml_schema_element.c
Instance Attribute Summary collapse
- #name ⇒ Object readonly
- #namespace ⇒ Object readonly
- #type ⇒ Object readonly
- #value ⇒ Object readonly
Instance Method Summary collapse
- #annotation ⇒ Object
- #array? ⇒ Boolean
- #elements ⇒ Object
- #max_occurs ⇒ Object
- #min_occurs ⇒ Object
- #node ⇒ Object
- #required? ⇒ Boolean
Instance Attribute Details
#name ⇒ Object (readonly)
#namespace ⇒ Object (readonly)
#type ⇒ Object (readonly)
#value ⇒ Object (readonly)
Instance Method Details
#annotation ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'ext/libxml/ruby_xml_schema_element.c', line 39 static VALUE rxml_schema_element_annot(VALUE self) { xmlSchemaElementPtr xelem; VALUE annotation = Qnil; Data_Get_Struct(self, xmlSchemaElement, 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; } |
#array? ⇒ Boolean
18 19 20 |
# File 'lib/libxml/schema/element.rb', line 18 def array? max_occurs > 1 end |
#elements ⇒ Object
22 23 24 |
# File 'lib/libxml/schema/element.rb', line 22 def elements type.elements end |
#max_occurs ⇒ Object
10 11 12 |
# File 'lib/libxml/schema/element.rb', line 10 def max_occurs @max end |
#min_occurs ⇒ Object
6 7 8 |
# File 'lib/libxml/schema/element.rb', line 6 def min_occurs @min end |
#node ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'ext/libxml/ruby_xml_schema_element.c', line 30 static VALUE rxml_schema_element_node(VALUE self) { xmlSchemaElementPtr xelem; Data_Get_Struct(self, xmlSchemaElement, xelem); return rxml_node_wrap(xelem->node); } |
#required? ⇒ Boolean
14 15 16 |
# File 'lib/libxml/schema/element.rb', line 14 def required? !min_occurs.zero? end |