Method: LibXML::XML::Document.string
- Defined in:
- lib/libxml/document.rb
.string(value, options = {}) ⇒ Object
call-seq:
XML::Document.string(string)
XML::Document.string(string, :encoding => XML::Encoding::UTF_8,
:options => XML::Parser::Options::NOENT
:base_uri="http://libxml.org") -> XML::Document
Creates a new document from the specified string.
You may provide an optional hash table to control how the parsing is performed. Valid options are:
base_uri - The base url for the parsed document.
encoding - The document encoding, defaults to nil. Valid values
are the encoding constants defined on XML::Encoding.
options - Parser options. Valid values are the constants defined on
XML::Parser::Options. Mutliple options can be combined
by using Bitwise OR (|).
75 76 77 |
# File 'lib/libxml/document.rb', line 75 def self.string(value, = {}) Parser.string(value, ).parse end |