# File lib/wsdl/xmlSchema/complexType.rb, line 79
  def attributes
    attrs = nil
    if @complexcontent
      attrs = @complexcontent.attributes + @attributes
    elsif @simplecontent
      attrs = @simplecontent.attributes + @attributes
    else
      attrs = @attributes
    end
    found = XSD::NamedElements.new
    attrs.each do |attr|
      case attr
      when Attribute
        found << attr
      when AttributeGroup
        if attr.attributes
          found.concat(attr.attributes)
        end
      when AnyAttribute
        # ignored
      else
        warn("unknown attribute: #{attr}")
      end
    end
    found
  end