• 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: <date> incompatibility between WebObjects and Cocoa in XML plists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: <date> incompatibility between WebObjects and Cocoa in XML plists


  • Subject: Re: <date> incompatibility between WebObjects and Cocoa in XML plists
  • From: "Mr. Pierre Frisch" <email@hidden>
  • Date: Wed, 23 Jan 2008 07:34:38 -0800

There was no plist xml output in 5.3 and the reading was incomplete so I am not sure what broke. I have been trying to follow the spec so that we can use standard tools to view and modify our plist.

Feel free to file a bug report I will have a look if I can fix it without breaking other thing.

Pierre
--
Pierre Frisch
email@hidden


On Jan 22, 2008, at 23:12, Alexander Spohr wrote:

Should we file one for <true /> and <integer> and the others that changed from 5.3 to 5.4 and broke existing code?



Am 23.01.2008 um 02:07 schrieb Mr. Pierre Frisch:

Could please file a bug report. Thank you.

Pierre
--
Pierre Frisch
email@hidden


On Jan 22, 2008, at 16:17, Wade Price wrote:

Now that WebObjects 5.4 has "full support" of XML plists, I was hoping that I could rely on NSPropertyListSerialization to exchange XML plists between Cocoa and WebObjects applications. However, I have found that the date representations used by Cocoa and WebObjects 5.4 to be incompatible.

In Cocoa, NSPropertyListSerialization encodes/decodes <date> using this format:

	yyyy-mm-ddTHH:MM:SSZ

For example:

NSData *xmlData = [NSPropertyListSerialization dataFromPropertyList:now
format:NSPropertyListXMLFormat_v1_0
errorDescription :&error];


produces:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd ">
<plist version="1.0">
<date>2008-01-22T23:17:14Z</date>
</plist>


However, in WebObjects 5.4, NSPropertyListSerialization encodes/ decodes <date> using this format:

yyyy-mm-dd HH:MM:SS.NNN GMT


For example:

String xmlString = NSPropertyListSerialization.xmlStringFromPropertyList(new NSTimestamp());

produces:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd ">
<plist version="1.0">
<date>2008-01-22 21:39:22.975 GMT</date>
</plist>


You might expect both Cocoa and WebObjects NSPropertyListSerialization to recognize both formats, but they don't.

Therefore:

Cocoa's NSPropertyListSerialization cannot decode a date encoded in an XML plist generated by WebObjects.
WebObjects' NSPropertyListSerialization cannot decode a date encoded in an XML plist generated by Cocoa.


I understand that Cocoa uses NSDate and WebObjects uses NSTimestamp to represent dates. But I would have thought they could have used a common XML representation.

I have been working around the problem that <date> isn't supported at all in WO 5.3. However, I was really hoping that WO 5.4 would allow me to ditch the workarounds.

Any thoughts?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

Freeport & Soliversum Alexander Spohr email@hidden www.freeport.de



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 ><date> incompatibility between WebObjects and Cocoa in XML plists (From: Wade Price <email@hidden>)
 >Re: <date> incompatibility between WebObjects and Cocoa in XML plists (From: Alexander Spohr <email@hidden>)

  • Prev by Date: Re: NPE in WOHTTPConnection readResponse()
  • Next by Date: Re: so i don't have to look them up
  • Previous by thread: Re: <date> incompatibility between WebObjects and Cocoa in XML plists
  • Next by thread: Help deploying in Eclipse
  • Index(es):
    • Date
    • Thread