Re: CoreData: XML escaping and exporting to another persistent store format
Re: CoreData: XML escaping and exporting to another persistent store format
- Subject: Re: CoreData: XML escaping and exporting to another persistent store format
- From: Charilaos Skiadas <email@hidden>
- Date: Thu, 14 Jul 2005 23:56:14 -0500
On Jul 14, 2005, at 11:27 PM, Jean Bovet wrote:
Hi,
I am quite new to Core Data so my questions maybe trivial:
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: "<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.
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?
Any reason you are not allowing the user to use whatever store type
they prefer?
Thanks for any tips!
Jean Bovet
Arizona Software
Haris
_______________________________________________
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