Say you have a Nokogiri document, for example through:
doc = Nokogiri::HTML(open(index.html))
When you now call doc.type
, a digit will be returned, in this case 13
.
What document type this translates to can be seen here:
http://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/Node#DOCUMENT_TYPE_NODE-constant
Notable examples:
9 - XML document
13 - HTML document