Created
August 12, 2012 16:27
-
-
Save glarizza/3332629 to your computer and use it in GitHub Desktop.
XML versus YAML
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >> hash = { 'key' => 'value' } | |
| => {"key"=>"value"} | |
| >> hash.to_yaml | |
| => "--- \nkey: value\n" | |
| >> Plist::Emit.dump(hash) | |
| => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>key</key>\n\t<string>value</string>\n</dict>\n</plist>\n" | |
| ## Here's YAML: | |
| --- | |
| key : value | |
| ## Now, Here's a Plist: | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-/Apple Computer/DTD PLIST 1.0/EN "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>key</key> | |
| <string>value</string> | |
| </dict> | |
| </plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment