def attribute(n, workitem=h.applied_workitem, options={})

      n = n.to_s

      default = options[:default]
      escape = options[:escape]
      string = options[:to_s] || options[:string]

      v = attributes[n]

      v = if v == nil
        default
      elsif escape
        v
      else
        dsub(v, workitem)
      end

      v = v.to_s if v and string

      v
    end
def attribute(n, workitem=h.applied_workitem, options={})

      n = n.to_s

      default = options[:default]
      escape = options[:escape]
      string = options[:to_s] || options[:string]

      v = attributes[n]

      v = if v == nil
        default
      elsif escape
        v
      else
        dsub(v, workitem)
      end

      v = v.to_s if v and string

      v
    end
Looks up the value for attribute n.