class LibXML::XML::Parser
def self.document(doc)
Parameters:
Creates a new parser for the specified document.
XML::Parser.document(document) -> XML::Parser
call-seq:
def self.document(doc) context = XML::Parser::Context.document(doc) self.new(context) end
def self.file(path, base_uri: nil, encoding: nil, options: nil)
XML::Parser::Options. Mutliple options can be combined
options - Parser options. Valid values are the constants defined on
are the encoding constants defined on XML::Encoding.
encoding - The document encoding, defaults to nil. Valid values
base_uri - The base url for the parsed document.
path - Path to file
Parameters:
Creates a new parser for the specified file or uri.
options: XML::Parser::Options::NOENT) -> XML::Parser
XML::Parser.file(path, encoding: XML::Encoding::UTF_8,
XML::Parser.file(path) -> XML::Parser
call-seq:
def self.file(path, base_uri: nil, encoding: nil, options: nil) context = XML::Parser::Context.file(path) context.base_uri = base_uri if base_uri context.encoding = encoding if encoding context.options = options if options self.new(context) end
def self.io(io, base_uri: nil, encoding: nil, options: nil)
XML::Parser::Options. Mutliple options can be combined
options - Parser options. Valid values are the constants defined on
are the encoding constants defined on XML::Encoding.
encoding - The document encoding, defaults to nil. Valid values
base_uri - The base url for the parsed document.
io - io object that contains the xml to parser
Parameters:
Creates a new parser for the specified io object.
base_uri: "http://libxml.org") -> XML::Parser
options: XML::Parser::Options::NOENT
XML::Parser.io(io, encoding: XML::Encoding::UTF_8,
XML::Parser.io(io) -> XML::Parser
call-seq:
def self.io(io, base_uri: nil, encoding: nil, options: nil) context = XML::Parser::Context.io(io) context.base_uri = base_uri if base_uri context.encoding = encoding if encoding context.options = options if options self.new(context) end
def self.register_error_handler(proc)
def self.register_error_handler(proc) warn('Parser.register_error_handler is deprecated. Use Error.set_handler instead') if proc.nil? Error.reset_handler else Error.set_handler(&proc) end end
def self.string(string, base_uri: nil, encoding: nil, options: nil)
XML::Parser::Options. Multiple options can be combined
options - Parser options. Valid values are the constants defined on
are the encoding constants defined on XML::Encoding.
encoding - The document encoding, defaults to nil. Valid values
base_uri - The base url for the parsed document.
string - The string to parse
Parameters:
Creates a new parser by parsing the specified string.
base_uri: "http://libxml.org") -> XML::Parser
options: XML::Parser::Options::NOENT
XML::Parser.string(string, encoding: XML::Encoding::UTF_8,
XML::Parser.string(string)
call-seq:
def self.string(string, base_uri: nil, encoding: nil, options: nil) context = XML::Parser::Context.string(string) context.base_uri = base_uri if base_uri context.encoding = encoding if encoding context.options = options if options self.new(context) end