123456789_123456789_123456789_123456789_123456789_

Class: Nokogiri::HTML4::EncodingReader::JumpSAXHandler

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Nokogiri::HTML4::EncodingReader::SAXHandler
Defined in: lib/nokogiri/html4/encoding_reader.rb

Class Method Summary

Instance Attribute Summary

SAXHandler - Inherited

Instance Method Summary

SAXHandler - Inherited

::Nokogiri::XML::SAX::Document - Inherited

#cdata_block

Called when cdata blocks are found [Parameters] - string contains the cdata content.

#characters

Called when character data is parsed, and for parsed entities when ParserContext#replace_entities is true.

#comment

Called when comments are encountered [Parameters] - string contains the comment data.

#end_document

Called when document ends parsing.

#end_element

Called at the end of an element.

#end_element_namespace

Called at the end of an element.

#error

Called on document errors [Parameters] - string contains the error.

#processing_instruction

Called when processing instructions are found [Parameters] - name is the target of the instruction - content is the value of the instruction.

#reference

Called when a parsed entity is referenced and not replaced.

#start_document

Called when document starts parsing.

#start_element

Called at the beginning of an element.

#start_element_namespace

Called at the beginning of an element.

#warning

Called on document warnings [Parameters] - string contains the warning.

#xmldecl

Called when an XML declaration is parsed.

Constructor Details

.new(jumptag) ⇒ JumpSAXHandler

[ GitHub ]

  
# File 'lib/nokogiri/html4/encoding_reader.rb', line 47

def initialize(jumptag)
  @jumptag = jumptag
  super()
end

Instance Method Details

#start_element(name, attrs = [])

[ GitHub ]

  
# File 'lib/nokogiri/html4/encoding_reader.rb', line 52

def start_element(name, attrs = [])
  super
  throw(@jumptag, @encoding) if @encoding
  throw(@jumptag, nil) if /\A(?:div|h1|img|p|br)\z/.match?(name)
end