class Nokogiri::XML::SAX::ParserContext

def file(input, encoding = nil)

is more convenient for most use cases.
💡 Calling this method directly is discouraged. Use Nokogiri::XML::SAX::Parser.parse_file which

[Returns] Nokogiri::XML::SAX::ParserContext

use (default +nil+, encoding will be autodetected)
- +encoding+ (optional) (Encoding, String) The +Encoding+ to use, or the name of an encoding to
- +path+ (String) The path to the input file
[Parameters]

Create a parser context for the file at +path+.

file(path, encoding)
file(path)
:call-seq:
##
def file(input, encoding = nil)
  native_file(input, resolve_encoding(encoding))
end