[TxMt] properties parser?
Xavier Noria
fxn at hashref.com
Tue Jan 4 20:39:42 UTC 2005
On Jan 4, 2005, at 9:17 PM, Allan Odgaard wrote:
> On Jan 4, 2005, at 21:10, Xavier Noria wrote:
>
>> I asked whether a parser exists before I write some even more dirty
>> hack because if for zero price I could robustly deal with the
>> elements of, say,
>
> Ah yes -- this is the standard old-style ASCII property list format.
> You can convert it to XML like this:
> plutil -convert xml1 <file>
Ahhh, excellent thank you.
> TextMate still understands the XML version, and this may be easier for
> you to work with. Basically the file is just a serialized
> array/dictionary (hash). OS X itself have parsers for this format, but
> if you convert it to XML you can use any XML parser to read them
> (using OS X has the advantage that it will build the structure in
> memory).
>
> Which language do you want to write it in?
In Perl or Python preferably. The XML solution via plutil looks like
the easiest, but for curiosity how would you deal with the structure in
memory without an intermediate XML file? If there was something in
Cocoa to deal directly with that format maybe I could play a bit with
PyObjC maybe.
-- fxn
More information about the textmate
mailing list