Displaying 1 result from an estimated 1 matches for "m000123".
Did you mean:
0000123
2009 Sep 04
3
libxml-ruby: How to handle XML::Parser::ParseError?
Code:
require "rubygems"
require "xml"
class TaskLoader
class BadXML < RuntimeError
end
def load_tasks
doc = XML::Parser.file( "qq.xml" ).parse
# ... work with document ...
rescue XML::Parser::ParseError, BadXML # this is line #40
# ...
end
end # TaskLoader
p TaskLoader.new.load_tasks # this is line #71
Output:
read_xml.rb:40:in