class ChupaText::Decomposers::OfficeOpenXML::SharedStringsListener
Public Class Methods
Source
# File lib/chupa-text/decomposers/office-open-xml.rb, line 124 def initialize(output, target_uri) @output = output @target_uri = target_uri @tag_stack = [] @in_target = false @current_text = +"" end
Public Instance Methods
Source
# File lib/chupa-text/decomposers/office-open-xml.rb, line 158 def cdata(content) @current_text << content if @in_target end
Source
# File lib/chupa-text/decomposers/office-open-xml.rb, line 154 def characters(text) @current_text << text if @in_target end
Source
# File lib/chupa-text/decomposers/office-open-xml.rb, line 143 def end_element(uri, local_name, qname) return unless uri == @target_uri case local_name when "t" add_text(@current_text) @in_target = false end ensure @tag_stack.pop end
Source
# File lib/chupa-text/decomposers/office-open-xml.rb, line 132 def start_element(uri, local_name, qname, attributes) @tag_stack << local_name return unless uri == @target_uri case local_name when "t" @in_target = true @current_text = +"" end end
Private Instance Methods
Source
# File lib/chupa-text/decomposers/office-open-xml.rb, line 163 def add_text(text) parent_tag = @tag_stack[-2] return unless parent_tag == "si" @output << text end