• 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: CoreData: XML escaping and exporting to another persistent store format
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData: XML escaping and exporting to another persistent store format


  • Subject: Re: CoreData: XML escaping and exporting to another persistent store format
  • From: mmalcolm crawford <email@hidden>
  • Date: Thu, 14 Jul 2005 22:06:00 -0700


On Jul 14, 2005, at 9:56 PM, Charilaos Skiadas wrote:

On Jul 14, 2005, at 11:27 PM, Jean Bovet wrote:
1) When using the XML store type, do I have to programmatically escape all my strings before putting them into my NSManagedObject's attribute (using CFXMLCreateStringByEscapingEntities for example) ? Is there a way to tell CoreData to do that ?
Forgive me, but surely it would be trivial to write and app to do check whether it does escape your strings. I tested with an app I had, and I input the string: "<key>" in a text field (so didn't do it programmatically, but have no reason to assume that the text field would change anything), and it saved it as: "&lt;key>".
So it does indeed escape entities. Though perhaps the documents should mention it, if they don't already. I would file an enhancement request against the documentation in that case.


First, it's not clear why one should think that anything would need to be escaped in the first place? Second, the file format is, strictly speaking, currently private, so it's unlikely to be documented...


2) What is the best way to implement an "export" feature that save the content of a managed context to a file with a different format (I have a SQL store and I want my export function to create a XML store for backup purpose) ? Should I add a new persistent store type and invoke save and then remove this persistent store ? Is there a more direct way to do that ?

Is this a Document application? I would not consider saving it as an XML store as an "export" feature. I would just incorporate is as a choice for the user what format to use in order to save the information. And NSPersistentDocument does this automatically for you, if you specify both store types in info.plist.
I any case, I would guess you would need an XML persistent store of some kind. I haven't really looked into it, but I would expect NSPersistentDocument to have methods that can help you with this. Is it really more than 5-6 commands?


<http://developer.apple.com/documentation/Cocoa/Reference/ CoreData_ObjC/Classes/NSPersistentStoreCoord.html#//apple_ref/doc/uid/ TP30001180-BBCFDEGA>

mmalc

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


References: 
 >CoreData: XML escaping and exporting to another persistent store format (From: Jean Bovet <email@hidden>)
 >Re: CoreData: XML escaping and exporting to another persistent store format (From: Charilaos Skiadas <email@hidden>)

  • Prev by Date: Re: CoreData: XML escaping and exporting to another persistent store format
  • Next by Date: More Sync Services Framework Questions...
  • Previous by thread: Re: CoreData: XML escaping and exporting to another persistent store format
  • Next by thread: Re: CoreData: XML escaping and exporting to another persistent store format
  • Index(es):
    • Date
    • Thread