    /*
     * call-seq:
     *   attribute_count
     *
     * Get the number of attributes for the current node
     */
    static VALUE attribute_count(VALUE self)
    {
      xmlTextReaderPtr reader;
      int count;

      Data_Get_Struct(self, xmlTextReader, reader);
      count = xmlTextReaderAttributeCount(reader);
      if(count == -1) return Qnil;

      return INT2NUM((long)count);
    }