#!/usr/bin/ruby -w
# encoding: utf-8
require 'plist'
def read_plist(plist_file)
result=Plist::parse_xml(plist_file)
i=0
result.each { |k, v|
i=i+1
puts k
puts v
puts
}
end
read_plist("features/dump/test.plist")
# encoding: utf-8
require 'plist'
def read_plist(plist_file)
result=Plist::parse_xml(plist_file)
i=0
result.each { |k, v|
i=i+1
puts k
puts v
puts
}
end
read_plist("features/dump/test.plist")
Sample plist file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Language</key>
<string>Svenska</string>
<key>Version</key>
<integer>4</integer>
</dict>
</plist>
very useful while readings strings for localisation (calabash)
No comments:
Post a Comment