require 'roo/excelx/extractor' module Roo class Excelx class Comments < Excelx::Extractor def comments @comments ||= extract_comments end private def extract_comments return {} unless doc_exists? doc.xpath('//comments/commentList/comment').each_with_object({}) do |comment, hash| value = comment.xpath('./text/r/t', './text/t').text hash[::Roo::Utils.ref_to_key(comment['ref'].to_s)] = value end end end end end # xl/comments1.xml # # # # # # # # # # # # # # # Comment for B4 # # # # # # # # # # # # Comment for B5 # # # # #