class LibXML::XML::Schema::Type
Attributes
kind[R]
name[R]
namespace[R]
Public Instance Methods
annonymus_subtypes()
click to toggle source
# File lib/libxml/schema/type.rb, line 8 def annonymus_subtypes elements.select { |_, e| e.type.name.nil? } end
annonymus_subtypes_recursively(parent=nil)
click to toggle source
# File lib/libxml/schema/type.rb, line 12 def annonymus_subtypes_recursively(parent=nil) annonymus_subtypes.map do |element_name, e| [{[parent, element_name].compact.join('::') => e.type}, e.type.annonymus_subtypes_recursively(element_name)] end.flatten end
annotation()
click to toggle source
static VALUE rxml_schema_type_annot(VALUE self) { VALUE result = Qnil; xmlSchemaTypePtr xtype; Data_Get_Struct(self, xmlSchemaType, xtype); if(xtype != NULL && xtype->annot != NULL && xtype->annot->content != NULL) { xmlChar *content = xmlNodeGetContent(xtype->annot->content); if (content) { result = rxml_new_cstr(content, NULL); xmlFree(content); } } return result; }
attributes()
click to toggle source
static VALUE rxml_schema_type_attributes(VALUE self) { VALUE result = rb_ary_new(); xmlSchemaTypePtr xtype; xmlSchemaAttributeUsePtr xuse; xmlSchemaItemListPtr xuses; int i; Data_Get_Struct(self, xmlSchemaType, xtype); xuses = xtype->attrUses; if (xuses != NULL) { for (i = 0; i < xuses->nbItems; i++) { xuse = (xmlSchemaAttributeUsePtr)xuses->items[i]; rb_ary_push(result, rxml_wrap_schema_attribute(xuse)); } } return result; }
base()
click to toggle source
static VALUE rxml_schema_type_base(VALUE self) { xmlSchemaTypePtr xtype; Data_Get_Struct(self, xmlSchemaType, xtype); return (xtype->baseType != xtype) ? rxml_wrap_schema_type(xtype->baseType) : Qnil; }
elements()
click to toggle source
static VALUE rxml_schema_type_elements(VALUE self) { VALUE result = rb_hash_new(); xmlSchemaTypePtr xtype; Data_Get_Struct(self, xmlSchemaType, xtype); rxmlSchemaCollectElements((xmlSchemaParticlePtr) xtype->subtypes, result); return result; }
facets()
click to toggle source
static VALUE rxml_schema_type_facets(VALUE self) { xmlSchemaTypePtr xtype; xmlSchemaFacetPtr xfacet; VALUE result = rb_ary_new(); VALUE facet; Data_Get_Struct(self, xmlSchemaType, xtype); xfacet = xtype->facets; while (xfacet != NULL) { facet = rxml_wrap_schema_facet((xmlSchemaFacetPtr)xfacet); rb_ary_push(result, facet); xfacet = xfacet->next; } return result; }
kind_name()
click to toggle source
# File lib/libxml/schema/type.rb, line 4 def kind_name Schema::Types.constants.find { |k| Schema::Types.const_get(k) == kind } end
node()
click to toggle source
static VALUE rxml_schema_type_node(VALUE self) { xmlSchemaTypePtr xtype; Data_Get_Struct(self, xmlSchemaType, xtype); return (xtype->node != NULL) ? rxml_node_wrap(xtype->node) : Qnil; }