Creates a new parser by parsing the specified file or uri.
You may provide an optional hash table to control how the parsing is performed. Valid options are:
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::HTMLParser::Options. Mutliple options can be combined by using Bitwise OR (|).
# File lib/libxml/html_parser.rb, line 21 21: def self.file(path, options = {}) 22: context = XML::HTMLParser::Context.file(path) 23: context.encoding = options[:encoding] if options[:encoding] 24: context.options = options[:options] if options[:options] 25: self.new(context) 26: end
Creates a new reader by parsing the specified io object.
Parameters:
io - io object that contains the xml to parser 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::HTMLParser::Options. Mutliple options can be combined by using Bitwise OR (|).
# File lib/libxml/html_parser.rb, line 45 45: def self.io(io, options = {}) 46: context = XML::HTMLParser::Context.io(io) 47: context.base_uri = options[:base_uri] if options[:base_uri] 48: context.encoding = options[:encoding] if options[:encoding] 49: context.options = options[:options] if options[:options] 50: self.new(context) 51: end
Creates a new parser by parsing 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::HTMLParser::Options. Mutliple options can be combined by using Bitwise OR (|).
# File lib/libxml/html_parser.rb, line 70 70: def self.string(string, options = {}) 71: context = XML::HTMLParser::Context.string(string) 72: context.base_uri = options[:base_uri] if options[:base_uri] 73: context.encoding = options[:encoding] if options[:encoding] 74: context.options = options[:options] if options[:options] 75: self.new(context) 76: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.