class Hpricot::DocType

@see Hpricot

def to_haml(tabs, options)

Other tags:
    See: Haml::HTML::Node#to_haml -
def to_haml(tabs, options)
  attrs = public_id.scan(/DTD\s+([^\s]+)\s*([^\s]*)\s*([^\s]*)\s*\/\//)[0]
  if attrs == nil
    raise Exception.new("Invalid doctype")
  end
  type, version, strictness = attrs.map { |a| a.downcase }
  if type == "html"
    version = "1.0"
    strictness = "transitional"
  end
  if version == "1.0" || version.empty?
    version = nil
  end
  if strictness == 'transitional' || strictness.empty?
    strictness = nil
  end
  version = " #{version}" if version
  strictness = " #{strictness.capitalize}" if strictness
  "#{tabulate(tabs)}!!!#{version}#{strictness}\n"
end