Class Nokogiri::XML::Reader
In: lib/nokogiri/xml/reader.rb
ext/nokogiri/html_document.c
Parent: Object

The Reader parser allows you to effectively pull parse an XML document. Once instantiated, call Nokogiri::XML::Reader#each to iterate over each node. Note that you may only iterate over the document once!

Methods

Included Modules

Enumerable

Attributes

encoding  [R]  The encoding for the document
errors  [RW]  A list of errors encountered while parsing
source  [R]  The XML source

Public Class methods

Public Instance methods

Get a list of attributes for this Node

Get the number of attributes for the current node

Get a list of attributes for the current node

Get a list of attributes for the current node.

Does this node have attributes?

Get the xml:base of the node

Was an attribute generated from the default value in the DTD or schema?

Get the depth of the node

Move the cursor through the document yielding each node to the block

Read the contents of the current node, including child nodes and markup. Returns a utf-8 encoded string.

Get the xml:lang scope within which the node resides.

Get the local name of the node

Get the name of the node. Returns a utf-8 encoded string.

Get the URI defining the namespace associated with the node

Get a hash of namespaces for this Node

Get the type of readers current node

Read the current node and its contents, including child nodes and markup. Returns a utf-8 encoded string.

Get the shorthand reference to the namespace associated with the node.

Move the Reader forward through the XML document.

Get the state of the reader

Get the text value of the node if present. Returns a utf-8 encoded string.

Does this node have a text value?

Get the XML version of the document being read

[Validate]