In the macOS, property list files are files that store serialized objects. Property list files use the filename extension .plist, and thus are often referred to as p-list files.
Here is an example of the content of a plist file:
<?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>Year Of Birth</key>
<integer>1965</integer>
<key>Pets Names</key>
<array/>
<key>Picture</key>
<data> PEKBpYGlmYFCPA==
</data>
<key>City of Birth</key>
<string>Springfield</string>
<key>Name</key>
<string>John Doe</string>
<key>Kids Names</key>
<array>
<string>John</string>
<string>Kyra</string>
</array>
</dict>
</plist>
The <plist> tag wraps the property list. The other tags used for the Core Foundation (Framework) data types are listed in the table below:
| CF type | XML tag |
|---|---|
| CFString | <string> |
| CFNumber | <real> or <integer> |
| CFDate | <date> |
| CFBoolean | <true/> or <false/> |
| CFData | <data> |
| CFArray | <array> |
| CFDictionary | <dict> |
When encoding the contents of a CFDictionary, each member is encoded by placing the dictionary key in a <key> tag and immediately following it with the corresponding value in the appropriate tag from the table above.
There are two formats of plist, XML as above and binary, but this article only describes the standard XML format.