Sha256: e9b2f709354e65b9ce05c84c091582242991399959c625cfcbd2ef1264577170
Contents?: true
Size: 545 Bytes
Versions: 10
Compression:
Stored size: 545 Bytes
Contents
#require 'axml' correct = '<scan num="12"> <peaks>ABCD</peaks> </scan> ' short = '<scan num="12"> <peaks>ABCD</peaks> ' long = '<scan num="12"> <peaks>ABCD</peaks> </scan> </scan> ' require 'xml/libxml' XML::Error.set_handler do |error| puts "GOTCAH!" #puts error.to_s end [correct, short, long].each do |str| reader = XML::Reader.string str x = reader.read p x end =begin x = AXML.parse(correct) puts x.to_s begin y = AXML.parse(short) rescue puts "RESCUED" puts y.to_s end #x = AXML.parse(long) #puts x.to_s =end
Version data entries
10 entries across 10 versions & 1 rubygems