# ri > Nokogiri::HTML4::Document

---
type: CommandReference
command: Nokogiri::HTML4::Document
mode: perldoc
section: ''
source: perldoc
---

## Quick Reference

- `Nokogiri::HTML4::Document.parse` — class method
- `fragment` — instance method
- `meta_encoding` — instance method
- `meta_encoding=` — instance method
- `serialize` — instance method
- `title` — instance method
- `title=` — instance method
- `xpath_doctype` — instance method

## Name

Nokogiri::HTML4::Document — class for HTML4 documents, subclass of Nokogiri::XML::Document

## Synopsis

text
Nokogiri::HTML4::Document.parse(io, url=nil, encoding=nil, options=nil, &block)
doc.fragment(...)
doc.meta_encoding
doc.meta_encoding = value
doc.serialize(...)
doc.title
doc.title = value
doc.xpath_doctype
## Methods

- `parse` — class method; parse HTML from an IO object or string
- `fragment` — parse a document fragment
- `meta_encoding` — get the meta encoding of the document
- `meta_encoding=` — set the meta encoding
- `serialize` — serialize the document to a string
- `title` — get the document title
- `title=` — set the document title
- `xpath_doctype` — get the doctype as an XPath expression

## See Also

- [Nokogiri::XML::Document](http://localhost/phpMan.php/perldoc/Nokogiri%3A%3AXML%3A%3ADocument/markdown)