Class: Nokogiri::HTML::SAX::Parser

Inherits:
XML::SAX::Parser show all
Defined in:
lib/nokogiri/html/sax/parser.rb

Instance Attribute Summary

Attributes inherited from XML::SAX::Parser

#document

Instance Method Summary collapse

Methods inherited from XML::SAX::Parser

#initialize, #parse, #parse_io

Constructor Details

This class inherits a constructor from Nokogiri::XML::SAX::Parser

Instance Method Details

#parse_file(filename, encoding = 'UTF-8') ⇒ Object

Parse a file with filename

Raises:

  • (Errno::ENOENT)


13
14
15
16
17
# File 'lib/nokogiri/html/sax/parser.rb', line 13

def parse_file filename, encoding = 'UTF-8'
  raise Errno::ENOENT unless File.exists?(filename)
  raise Errno::EISDIR if File.directory?(filename)
  native_parse_file filename, encoding
end

#parse_memory(data, encoding = 'UTF-8') ⇒ Object

Parse html stored in data using encoding



7
8
9
# File 'lib/nokogiri/html/sax/parser.rb', line 7

def parse_memory data, encoding = 'UTF-8'
  native_parse_memory(data, encoding)
end