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

call-seq:

 meta_encoding

Get the meta tag encoding for this document.

Methods

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

External Aliases

serialize -> to_xml
dup -> clone

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::ParseOptions::RECOVER. See the constants in Nokogiri::XML::ParseOptions.

Public Instance methods

<<(child)

Alias for add_child

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 this Document against it‘s DTD. Returns a list of errors on the document or nil when there is no DTD.

[Validate]