GIF87a;
module REXML class ParseException < RuntimeError attr_accessor :source, :parser, :continued_exception def initialize( message, source=nil, parser=nil, exception=nil ) super(message) @source = source @parser = parser @continued_exception = exception end def to_s # Quote the original exception, if there was one if @continued_exception err = @continued_exception.inspect err << "\n" err << @continued_exception.backtrace.join("\n") err << "\n...\n" else err = "" end # Get the stack trace and error message err << super # Add contextual information if @source err << "\nLine: #{line}\n" err << "Position: #{position}\n" err << "Last 80 unconsumed characters:\n" err << @source.buffer[0..80].force_encoding("ASCII-8BIT").gsub(/\n/, ' ') end err end def position @source.current_line[0] if @source and defined? @source.current_line and @source.current_line end def line @source.current_line[2] if @source and defined? @source.current_line and @source.current_line end def context @source.current_line end end end
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
dtd | Folder | 0755 |
|
|
formatters | Folder | 0755 |
|
|
light | Folder | 0755 |
|
|
parsers | Folder | 0755 |
|
|
validation | Folder | 0755 |
|
|
attlistdecl.rb | File | 1.89 KB | 0644 |
|
attribute.rb | File | 5.39 KB | 0644 |
|
cdata.rb | File | 1.54 KB | 0644 |
|
child.rb | File | 2.63 KB | 0644 |
|
comment.rb | File | 2.14 KB | 0644 |
|
doctype.rb | File | 6.58 KB | 0644 |
|
document.rb | File | 9.52 KB | 0644 |
|
element.rb | File | 43.85 KB | 0644 |
|
encoding.rb | File | 1.13 KB | 0644 |
|
entity.rb | File | 5.53 KB | 0644 |
|
functions.rb | File | 11.27 KB | 0644 |
|
instruction.rb | File | 2.01 KB | 0644 |
|
namespace.rb | File | 1.09 KB | 0644 |
|
node.rb | File | 2.13 KB | 0644 |
|
output.rb | File | 519 B | 0644 |
|
parent.rb | File | 4.33 KB | 0644 |
|
parseexception.rb | File | 1.22 KB | 0644 |
|
quickpath.rb | File | 9.08 KB | 0644 |
|
rexml.rb | File | 1.65 KB | 0644 |
|
sax2listener.rb | File | 3.6 KB | 0644 |
|
source.rb | File | 7.6 KB | 0644 |
|
streamlistener.rb | File | 3.88 KB | 0644 |
|
syncenumerator.rb | File | 685 B | 0644 |
|
text.rb | File | 13.57 KB | 0644 |
|
undefinednamespaceexception.rb | File | 210 B | 0644 |
|
xmldecl.rb | File | 2.68 KB | 0644 |
|
xmltokens.rb | File | 526 B | 0644 |
|
xpath.rb | File | 3.31 KB | 0644 |
|
xpath_parser.rb | File | 25.7 KB | 0644 |
|