123456789_123456789_123456789_123456789_123456789_

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

Instance Method Summary

Instance Attribute Details

#array?Boolean (readonly)

[ GitHub ]

  
# File 'lib/libxml/schema/element.rb', line 18

def array?
  max_occurs > 1
end

#namespace (readonly)

[ GitHub ]

#required?Boolean (readonly)

[ GitHub ]

  
# File 'lib/libxml/schema/element.rb', line 14

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;

  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;
}

#elements

[ GitHub ]

  
# File 'lib/libxml/schema/element.rb', line 22

def elements
  type.elements
end

#max_occurs

[ GitHub ]

  
# File 'lib/libxml/schema/element.rb', line 10

def max_occurs
  @max
end

#min_occurs

[ GitHub ]

  
# File 'lib/libxml/schema/element.rb', line 6

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;

  Data_Get_Struct(self, xmlSchemaElement, xelem);

  return rxml_node_wrap(xelem->node);
}