class Repoaccessor::XMLParser
Public Class Methods
parse(file)
click to toggle source
returning an XMLFile
object , with to_hash to_json method.
# File lib/repoaccessor/xmlparser.rb, line 9 def self.parse(file) xmlfile = XMLFile.new() resourcefile = File.new(file) doc = REXML::Document.new resourcefile doc.elements.each("resources/string") { |e| key = e.attributes["name"] value = e.text kv = KV_pair.new(key,value,"") xmkfile.kv_pairs << kv } xmlfile end