Sha256: c3e1228898a7fb45035e132a8bb34a51cd946ec1291c9b87dfd4cfc869df6368
Contents?: true
Size: 895 Bytes
Versions: 10
Compression:
Stored size: 895 Bytes
Contents
module Nokogiri module XML module SAX class Parser attr_accessor :document def initialize(doc = XML::SAX::Document.new) @document = doc end ### # Parse given +thing+ which may be a string containing xml, or an # IO object. def parse thing if thing.respond_to?(:read) && thing.respond_to?(:close) parse_io(thing) else parse_memory(thing) end end ### # Parse given +io+ def parse_io io, encoding = 0 native_parse_io io, encoding end ### # Parse a file with +filename+ def parse_file filename raise Errno::ENOENT unless File.exists?(filename) raise Errno::EISDIR if File.directory?(filename) native_parse_file filename end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems