• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: XML and NSDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XML and NSDictionary


  • Subject: Re: XML and NSDictionary
  • From: Lionel GUILLAUME <email@hidden>
  • Date: Tue, 11 May 2004 14:29:40 +0200

Thank you form your answer.
I tried WOXMLCoder and NSXMLOutputStream too, but it doesn't give me a XML with the same
DTD.
The transformation that should be done is not serialisation in XML. It looks like a plist.


Jean-Frangois GUILLAUD wrote:

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.


References: 
 >XML and NSDictionary (From: Lionel GUILLAUME <email@hidden>)
 >Re: XML and NSDictionary (From: Jean-François GUILLAUD <email@hidden>)

  • Prev by Date: Re: XML and NSDictionary
  • Next by Date: (no subject)
  • Previous by thread: Re: XML and NSDictionary
  • Next by thread: WOToOneRelationship default value
  • Index(es):
    • Date
    • Thread