Sample code for 30+ languages & platforms
Ruby

Load XML from Local FilePath

Demonstrates how to load XML from a local XML file.

Chilkat Ruby Downloads

Ruby
require 'chilkat'

success = false

xml = Chilkat::CkXml.new()

# Pass either an absolute file path, or a file path relative from the current working directory of the caller.
success = xml.LoadXmlFile("qa_data/hamlet.xml")
if (success == false)
    print xml.lastErrorText() + "\n";
    exit
end

print "Success." + "\n";