Exception: Nokogiri::XML::SyntaxError
- Inherits:
-
SyntaxError
- Object
- StandardError
- SyntaxError
- Nokogiri::XML::SyntaxError
- Defined in:
- lib/nokogiri/xml/syntax_error.rb,
ext/nokogiri/xml_syntax_error.c
Overview
This class provides information about XML SyntaxErrors. These exceptions are typically stored on Nokogiri::XML::Document#errors.
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#int1 ⇒ Object
readonly
Returns the value of attribute int1.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#str1 ⇒ Object
readonly
Returns the value of attribute str1.
-
#str2 ⇒ Object
readonly
Returns the value of attribute str2.
-
#str3 ⇒ Object
readonly
Returns the value of attribute str3.
Instance Method Summary collapse
-
#error? ⇒ Boolean
return true if this is an error.
-
#fatal? ⇒ Boolean
return true if this error is fatal.
-
#none? ⇒ Boolean
return true if this is a non error.
- #to_s ⇒ Object
-
#warning? ⇒ Boolean
return true if this is a warning.
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
10 11 12 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 10 def code @code end |
#column ⇒ Object (readonly)
Returns the value of attribute column.
18 19 20 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 18 def column @column end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
9 10 11 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 9 def domain @domain end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
12 13 14 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 12 def file @file end |
#int1 ⇒ Object (readonly)
Returns the value of attribute int1.
17 18 19 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 17 def int1 @int1 end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
11 12 13 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 11 def level @level end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
13 14 15 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 13 def line @line end |
#str1 ⇒ Object (readonly)
Returns the value of attribute str1.
14 15 16 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 14 def str1 @str1 end |
#str2 ⇒ Object (readonly)
Returns the value of attribute str2.
15 16 17 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 15 def str2 @str2 end |
#str3 ⇒ Object (readonly)
Returns the value of attribute str3.
16 17 18 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 16 def str3 @str3 end |
Instance Method Details
#error? ⇒ Boolean
return true if this is an error
34 35 36 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 34 def error? level == 2 end |
#fatal? ⇒ Boolean
return true if this error is fatal
40 41 42 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 40 def fatal? level == 3 end |
#none? ⇒ Boolean
return true if this is a non error
22 23 24 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 22 def none? level == 0 end |
#to_s ⇒ Object
44 45 46 47 48 49 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 44 def to_s = super.chomp [location_to_s, level_to_s, ] .compact.join(": ") .force_encoding(.encoding) end |
#warning? ⇒ Boolean
return true if this is a warning
28 29 30 |
# File 'lib/nokogiri/xml/syntax_error.rb', line 28 def warning? level == 1 end |