Ruby 2.4.0 リファレンスマニュアル > ライブラリ一覧 > rexml/documentライブラリ > REXML::DocTypeクラス > name
name -> String
[permalink][rdoc]ルート要素名を返します。
document = REXML::Document.new(<<EOS)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
EOS
doctype = document.doctype
p doctype.name # => "html"