class ExtractSharedStrings

Public Class Methods

extract(input) click to toggle source
# File src/extract/extract_shared_strings.rb, line 5
def self.extract(input)
  self.new.extract(input)
end

Public Instance Methods

end_element(name) click to toggle source
# File src/extract/extract_shared_strings.rb, line 20
def end_element(name)
  return unless name == :si
  @output << [:string, @current.join]
  @current = nil
end
extract(input_xml) click to toggle source
# File src/extract/extract_shared_strings.rb, line 9
def extract(input_xml)
  @output = []
  @current = nil
  Ox.sax_parse(self, input_xml, :convert_special => true)
  @output
end
start_element(name) click to toggle source
# File src/extract/extract_shared_strings.rb, line 16
def start_element(name)
  @current = [] if name == :si
end
text(string) click to toggle source
# File src/extract/extract_shared_strings.rb, line 26
def text(string)
  return unless @current
  # FIXME: SHOULDN'T ELINMATE NEWLINES
  @current << string#.gsub("\n","")
end