class LibXML::XML::Schema::Type
Attributes
Public Instance Methods
Source
static VALUE rxml_schema_type_annot(VALUE self)
{
VALUE result = Qnil;
xmlSchemaTypePtr xtype;
TypedData_Get_Struct(self, xmlSchemaType, &rxml_schema_type_type, 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;
}
Source
static VALUE rxml_schema_type_attributes(VALUE self)
{
VALUE result = rb_ary_new();
xmlSchemaTypePtr xtype;
xmlSchemaAttributeUsePtr xuse;
xmlSchemaItemListPtr xuses;
int i;
TypedData_Get_Struct(self, xmlSchemaType, &rxml_schema_type_type, 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;
}
Source
static VALUE rxml_schema_type_base(VALUE self)
{
xmlSchemaTypePtr xtype;
TypedData_Get_Struct(self, xmlSchemaType, &rxml_schema_type_type, xtype);
return (xtype->baseType != xtype) ? rxml_wrap_schema_type(xtype->baseType) : Qnil;
}
Source
static VALUE rxml_schema_type_elements(VALUE self)
{
VALUE result = rb_hash_new();
xmlSchemaTypePtr xtype;
TypedData_Get_Struct(self, xmlSchemaType, &rxml_schema_type_type, xtype);
rxmlSchemaCollectElements((xmlSchemaParticlePtr) xtype->subtypes, result);
return result;
}
Source
static VALUE rxml_schema_type_facets(VALUE self)
{
xmlSchemaTypePtr xtype;
xmlSchemaFacetPtr xfacet;
VALUE result = rb_ary_new();
VALUE facet;
TypedData_Get_Struct(self, xmlSchemaType, &rxml_schema_type_type, xtype);
xfacet = xtype->facets;
while (xfacet != NULL)
{
facet = rxml_wrap_schema_facet((xmlSchemaFacetPtr)xfacet);
rb_ary_push(result, facet);
xfacet = xfacet->next;
}
return result;
}
Source
static VALUE rxml_schema_type_node(VALUE self)
{
xmlSchemaTypePtr xtype;
TypedData_Get_Struct(self, xmlSchemaType, &rxml_schema_type_type, xtype);
return (xtype->node != NULL) ? rxml_node_wrap(xtype->node) : Qnil;
}