Skip to content

Instantly share code, notes, and snippets.

@miyo
Created April 13, 2021 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miyo/67796961700d7e1ed46d286a496326f5 to your computer and use it in GitHub Desktop.
Save miyo/67796961700d7e1ed46d286a496326f5 to your computer and use it in GitHub Desktop.
require 'nokogiri'
xml = Nokogiri::XML($stdin)
texts = xml.xpath('//xmlns:text')
texts.each{|text|
str = ""
text.xpath('xmlns:tspan').each{|n|
str += n.text
}
puts str
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment