Skip to content

Instantly share code, notes, and snippets.

@Alfaj0r
Alfaj0r / ps_template_parser.rb
Created January 31, 2012 23:10 — forked from elskwid/ps_template_parser.rb
Powerscribe templates XML parsing
#!/usr/bin/env ruby
require 'rexml/document'
include REXML
#open the XML file exported from Powerscribe
# Ruby lets us open the file in a block (thereby closing it when it's done)
File.open("Voice.xml") do |file|
# The "block" is that do ... end syntax and |file| is a reference to the file we've opened
doc = Document.new(file)
@Alfaj0r
Alfaj0r / ps_template_parser.rb
Created January 31, 2012 22:39
Powerscribe templates XML parsing
#!/usr/bin/env ruby
require 'rexml/document'
include REXML
#open the XML file exported from Powerscribe
file = File.new("Voice.xml")
doc = Document.new(file)
root = doc.root
#for each element of listed in the XML file we want to: