Class Nokogiri::XML::Document
In: lib/nokogiri/ffi/xml/document.rb
lib/nokogiri/xml/document.rb
ext/nokogiri/html_document.c
Parent: Node

Nokogiri::XML::Document is the main entry point for dealing with XML documents. The Document is created by parsing an XML document. See Nokogiri.XML()

For searching a Document, see Nokogiri::XML::Node#css and Nokogiri::XML::Node#xpath

Methods

decorate   decorators   document   dup   encoding   encoding=   fragment   name   namespaces   new   new   parse   read_io   read_memory   root   root=   slop!   url  

External Aliases

serialize -> to_xml
serialize -> inner_html

Attributes

errors  [RW]  A list of Nokogiri::XML::SyntaxError found when parsing a document

Public Class methods

Create a new document with version (defaults to "1.0")

Parse an XML file. thing may be a String, or any object that responds to read and close such as an IO, or StringIO. url is resource where this document is located. encoding is the encoding that should be used when processing the document. options is a number that sets options in the parser, such as Nokogiri::XML::PARSE_RECOVER. See the constants in Nokogiri::XML.

Public Instance methods

Apply any decorators to node

Get the list of decorators given key

A reference to self

Copy this Document. An optional depth may be passed in, but it defaults to a deep copy. 0 is a shallow copy, 1 is a deep copy.

Get the encoding for this Document

Set the encoding string for this Document

The name of this document. Always returns "document"

Get the root node for this document.

Set the root element on this document

Explore a document with shortcut methods.

Get the url name for this document.

[Validate]