class Nokogiri::XML::AttributeDecl - nokogiri-1.15.2 Documentation

# class Nokogiri::XML::AttributeDecl

Represents an attribute declaration in a `DTD`

### Public Instance Methods

attribute_type click to toggle source

The `attribute_type` for this `AttributeDecl`

    static VALUE
    attribute_type(VALUE self)
    {
      xmlAttributePtr node;
      Noko_Node_Get_Struct(self, xmlAttribute, node);
      return INT2NUM(node->atype);
    }

default click to toggle source

The default value

    static VALUE
    default_value(VALUE self)
    {
      xmlAttributePtr node;
      Noko_Node_Get_Struct(self, xmlAttribute, node);

      if (node->defaultValue) { return NOKOGIRI_STR_NEW2(node->defaultValue); }
      return Qnil;
    }

enumeration click to toggle source

An enumeration of possible values

    static VALUE
    enumeration(VALUE self)
    {
      xmlAttributePtr node;
      xmlEnumerationPtr enm;
      VALUE list;

      Noko_Node_Get_Struct(self, xmlAttribute, node);

      list = rb_ary_new();
      enm = node->tree;

      while (enm) {
        rb_ary_push(list, NOKOGIRI_STR_NEW2(enm->name));
        enm = enm->next;
      }

      return list;
    }

### Private Instance Methods

inspect_attributes() click to toggle source

    # File lib/nokogiri/xml/attribute_decl.rb, line 17
    def inspect_attributes
      [:to_s]
    end