[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XML plists ?

From: Richard Frith-Macdonald
Subject: Re: XML plists ?
Date: Wed, 5 Sep 2001 17:08:45 +0000

On Wednesday, September 5, 2001, at 11:01 PM, Marko Mikulicic wrote:


I tried to set XML property lists.
After I wrote "defaults write NSGlobalDomain GSMacOSXCompatiblePropertyLists"
(twice to get an XML .GNUstepDefaults)
my .GNUstepDefaults looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">

but any gnustep program complains:

.:1: error: Extra content at the end of the document

I think I traced that one down a few months ago and found that the iconv code in libc (used for handling UTF8 encoded data - which is what property lists are) failed on long strings. To fix this you need to install a newer libc (if you are brave), get a separate iconv library and rebuild the base library configured to use this (I
haven't tried that), upgrade your operating system, or as a hack you
can modify the GSPropertyList() function in NSString.m to use NSASCIIStringEncoding rather than NSUTF8StringEncoding - which will be fine as long as you don't have any
non-ascii characters in your property list.

How can NSUserDefaults know to read .GNUstepDefaults in XML format
if that information is stored in that file itself ?
Does it (or should) read the "<?xml" stuff ?


Maybe I must recompile all with some flag?

I would like to use external XML editors to play with property lists
but I really like the objc interface with dictionaries so I don't want
to use libxml directly.
 Is XML support in gnustep still unfinished ?

I'd call it beta ... since I'm not sure how it *should* behave ...
At the moment, with XML output turned on, you get XML descriptions of all
property list objects, and I think it might be nicer if XML was only produced
when saving to file.
However, the generation and parsing of XML property lists seems to work fine.

Can I instruct NSDictionary to read and write a plist in XML while
preserving defaults as normal plists ?

No - since defaults are implemented by reading and writing dictionaries.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]