Class: Nokogiri::XML::ParseOptions
- Inherits:
-
Object
- Object
- Nokogiri::XML::ParseOptions
- Defined in:
- lib/nokogiri/xml/parse_options.rb
Overview
Parse options for passing to Nokogiri.XML or Nokogiri.HTML
Constant Summary collapse
- STRICT =
Strict parsing
0
- RECOVER =
Recover from errors
1 << 0
- NOENT =
Substitute entities
1 << 1
- DTDLOAD =
Load external subsets
1 << 2
- DTDATTR =
Default DTD attributes
1 << 3
- DTDVALID =
validate with the DTD
1 << 4
- NOERROR =
suppress error reports
1 << 5
- NOWARNING =
suppress warning reports
1 << 6
- PEDANTIC =
pedantic error reporting
1 << 7
- NOBLANKS =
remove blank nodes
1 << 8
- SAX1 =
use the SAX1 interface internally
1 << 9
- XINCLUDE =
Implement XInclude substitition
1 << 10
- NONET =
Forbid network access
1 << 11
- NODICT =
Do not reuse the context dictionnary
1 << 12
- NSCLEAN =
remove redundant namespaces declarations
1 << 13
- NOCDATA =
merge CDATA as text nodes
1 << 14
- NOXINCNODE =
do not generate XINCLUDE START/END nodes
1 << 15
- DEFAULT_XML =
the default options used for parsing XML documents
RECOVER
- DEFAULT_HTML =
the default options used for parsing HTML documents
RECOVER | NOERROR | NOWARNING | NONET
Instance Attribute Summary collapse
-
#options ⇒ Object
(also: #to_i)
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = STRICT) ⇒ ParseOptions
constructor
A new instance of ParseOptions.
- #inspect ⇒ Object
- #strict ⇒ Object
- #strict? ⇒ Boolean
Constructor Details
#initialize(options = STRICT) ⇒ ParseOptions
Returns a new instance of ParseOptions.
47 48 49 |
# File 'lib/nokogiri/xml/parse_options.rb', line 47 def initialize = STRICT @options = end |
Instance Attribute Details
#options ⇒ Object Also known as: to_i
Returns the value of attribute options.
46 47 48 |
# File 'lib/nokogiri/xml/parse_options.rb', line 46 def @options end |
Instance Method Details
#inspect ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/nokogiri/xml/parse_options.rb', line 76 def inspect = [] self.class.constants.each do |k| << k.downcase if send(:"#{k.downcase}?") end super.sub(/>$/, " " + .join(', ') + ">") end |
#strict ⇒ Object
65 66 67 68 |
# File 'lib/nokogiri/xml/parse_options.rb', line 65 def strict @options &= ~RECOVER self end |