Class Jmdict::ImportXmlListener
In: lib/jmdict/import_xml_listener.rb
Parent: Jmdict::ImportListener

Methods

Included Modules

REXML::StreamListener

Public Class methods

[Source]

   # File lib/jmdict/import_xml_listener.rb, line 6
6:   def initialize(filename, version, maximum_parsed = nil)
7:     super(filename, version, maximum_parsed)
8:     @source_description     = 'xml version [' + version + '] imported on ' + DateTime.now.to_s
9:   end

Public Instance methods

[Source]

    # File lib/jmdict/import_xml_listener.rb, line 18
18:   def cleanup_entity(entity)
19:     return entity.gsub(/^&/,'').gsub(/;$/,'')
20:   end

[Source]

    # File lib/jmdict/import_xml_listener.rb, line 22
22:   def entitydecl(content)
23:      @_entities["&#{content[0]};"] = content[1]
24:   end

[Source]

    # File lib/jmdict/import_xml_listener.rb, line 26
26:   def tag_end name
27:     @_current_tag = nil
28:     method = "end_#{name}"
29:     self.send(method) if methods.include? method
30:   end

[Source]

    # File lib/jmdict/import_xml_listener.rb, line 11
11:   def tag_start(name, attrs)
12:     return if @_skip_entry
13:     @_current_tag = name
14:     method = "start_#{name}"
15:     self.send(method, attrs) if methods.include? method
16:   end

encoding, standaloneは、指定がなければnil

[Source]

    # File lib/jmdict/import_xml_listener.rb, line 33
33:   def xmldecl(version, encoding, standalone) 
34:     # intentionally ignore
35:   end

[Validate]