Skip to content

Instantly share code, notes, and snippets.

@clofresh
Created June 3, 2011 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clofresh/1006428 to your computer and use it in GitHub Desktop.
Save clofresh/1006428 to your computer and use it in GitHub Desktop.
How plists use xml wrong
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