Class: TestdataText
- Inherits:
-
Object
- Object
- TestdataText
- Defined in:
- lib/testdata_text.rb
Class Method Summary collapse
Class Method Details
.parse(raw_txt) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/testdata_text.rb', line 15 def self.parse(raw_txt) txt = raw_txt.split(/(?=\n=begin)/m)\ .map {|x| x.sub(/\n=begin.*=end/m,'')}.join rowx = RowX.new(txt, level: 1) xml = rowx.to_xml lib = File.dirname(__FILE__) xsl = File.open(lib/'testdata.xsl','r').read doc = Nokogiri::XML(xml) xslt = Nokogiri::XSLT(xsl) xslt.transform(doc).to_s end |