Created
June 3, 2011 14:38
-
-
Save clofresh/1006428 to your computer and use it in GitHub Desktop.
How plists use xml wrong
This file contains 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
It goes: | |
<dict> | |
<key>key1</key> | |
<string>val1</string> | |
<key>key2</key> | |
<string>val2</string> | |
</dict> | |
Which translate to | |
{ | |
key1: "val1", | |
key2: "val2" | |
} | |
But it's annoying to parse because the value is a sibling of the key, so you have to maintain state in knowing which line you're on. | |
It should be something like | |
<dict> | |
<item key="key1"> | |
<string>val1</string> | |
</item> | |
<item key="key2"> | |
<string>val2</string> | |
</item> | |
</dict> | |
Unless you REALLY REALLY need to be able to assign attributes to your key value, which I doubt. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment