Re: XML and NSDictionary
Re: XML and NSDictionary
- Subject: Re: XML and NSDictionary
- From: Jean-François GUILLAUD <email@hidden>
- Date: Tue, 11 May 2004 13:50:58 +0200
- Organization: CRI - Universite de La Rochelle
Hi Lionel,
Did you try with WOXMLCoder and WOXMLDecoder ? I tried it for tests
(about a year ago) and it seemed to work.
I couldn't use it because I had specific needs.
Have a look at WOXMLCoder.*encodeRootObjectForKey()*.
See javadoc for WOXMLDecoder for more help and explanation about mapping
files (I tried it as well), it could be interesting.
And try to download an example at:
http://developer.apple.com/samplecode/XML_Transport/XML_Transport.html
Jeff
Lionel GUILLAUME a icrit :
Hi,
I am writting a web interface with WO to manage the postfix mail server
include with MacOSX Server.
The apple mail server use the a xml ldap attribute to manage mailbox :
<?xml version="1.0" encoding="UTF-8"?>
<dict>
<key>kAPOPRequired</key>
<string>APOPNotRequired</string>
<key>kAltMailStoreLoc</key>
<string></string>
<key>kAttributeVersion</key>
<string>Apple Mail 1.0</string>
<key>kAutoForwardValue</key>
<string></string>
<key>kIMAPLoginState</key>
<string>IMAPAllowed</string>
<key>kMailAccountLocation</key>
<string>192.168.0.6</string>
<key>kMailAccountState</key>
<string>Enabled</string>
<key>kPOP3LoginState</key>
<string>POP3Allowed</string>
<key>kUserDiskQuota</key>
<string>0</string>
</dict>
I use the following syntax to parse it an create a NSDictionay :
NSDictionary dict =
NSPropertyListSerialization.dictionaryForString((String)a.storedValueForKey("mailOption"));
NSMutableDictionary mDict = new NSMutableDictionary (dict);
mDict.setObjectForKey ("kUserDiskQuota", "100");
So I can modify the NSMutableDictionary as I want, but I don't hnow how
to transform it to XML
after modifications.
I tried the stringFromPropertyList(Object plist) method but the String
result is not XML.
I think I should use the dataFromPropertyList(Object object,
String encoding) method but the String result is not XML because the
encoding is not set properly.
Does someone have an idea ?
<cid:email@hidden>
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.