• 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: Tue, 22 Jan 2008 17:07:38 -0800

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

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

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

  • Prev by Date: Re: WOLips: 80 character width gutter?
  • Next by Date: Re: WOLips: 80 character width gutter?
  • Previous by thread: <date> incompatibility between WebObjects and Cocoa in XML plists
  • Next by thread: Re: <date> incompatibility between WebObjects and Cocoa in XML plists
  • Index(es):
    • Date
    • Thread