       else if _.isString(value)
         @[attrname].value = value
       else if _.isObject(value)
+        value = @_fix_singleton_array_value(value)
         @[attrname] = _.extend(@[attrname], value)
       else
         logger.warn("string property '#{attrname}' given invalid value: #{value}")

        else
          @[attrname].field = value
      else if _.isObject(value)
        @[attrname] = _.extend(@[attrname], value)
      else
        logger.warn("enum property '#{attrname}' given invalid value: #{value}")

          retval.push(default_value)
        return retval

    _fix_singleton_array_value: (obj) ->
      # XXX: this is required because we can't distinguish between
      # cases like Text(text="field") and Text(test="actual text").
      if obj.value?
        value = obj.value

        if _.isArray(value)
          if value.length == 1
            return _.extend({}, obj, {value: value[0]})
          else
            throw new Error("expected an array of length 1, got #{value}")

      return obj

    string: (styleprovider, attrname) ->
      @[attrname] = {}

