.plist vs .xml
November 3, 2004 10:47 AM   Subscribe

What is the difference between a .plist and a .xml file in OS X? They both look the same.
posted by thebwit to Computers & Internet (3 answers total)
.plist files are XML, just in a particular format. The name stands for "Property List". Here's some documentation.

There is also an older property list file format which isn't based on XML, but you're most likely to see the XML version these days.
posted by xil at 10:56 AM on November 3, 2004

You can look at the !DOCTYPE tag in an XML file to see what document type it is. A plist is just an XML document type. Document types are defined using documents called Document Type Descriptions, or DTDs. If you look at the !DOCTYPE, you'll see that Apple's DTD for plist files is -//Apple Computer//DTD PLIST 1.0//EN and is available at http://www.apple.com/DTDs/PropertyList-1.0.dtd.
posted by kindall at 11:17 AM on November 3, 2004

There are a handful of different formats for storing the same data. There's the old, more easily human-readable property list format; there's the new, XML-based property list format; there's a compact binary plist format. Most of the functions which read property lists can accept one in any of these formats (even if they're not documented to do so).

The XML format has the advantage of being able to store NSDates (which the older human-readable one can't) and in distinguishing between integers, reals, booleans, and strings which are representations of integers, reals, and booleans. On the other hand, it takes up a ton more space.

In all cases a 'property list' is conceptually just a structure consisting of numbers, strings, and other 'atomic' types (NSDatas, booleans, dates, etc.); and of arrays and string-keyed dictionaries of same (recursively).
posted by hattifattener at 6:50 PM on November 3, 2004

« Older Non-Skype VOIP   |   Unbiased political writing? Newer »
This thread is closed to new comments.