Re: Core Data reads xml store value @" " as @""
Re: Core Data reads xml store value @" " as @""
- Subject: Re: Core Data reads xml store value @" " as @""
- From: Ricky Sharp <email@hidden>
- Date: Fri, 20 Feb 2009 18:51:22 -0600
On Feb 20, 2009, at 6:45 PM, Jerry Krinock wrote:
There is an attribute in my Core Data document-based app whose
string value can legitimately be a single single utf8 0x20 space
character, @" ". (It's a user-selectable delimiter.)
When I save a document with this attribute value, reading the XML
store file with BBEdit shows that it is a single space character,
like this:
<attribute name="firstname" type="string"> </attribute>
I'd file that as a bug. The XML above, while legal, will most likely
always result in a value of <attribute> being an empty string.
Whitespace is typically trimmed by XML parsers.
e.g. if you had:
<attribute ...>[NEW LINE]
[TAB][SPACE][NEW_LINE]
</attribute>
You'd typically still get an empty string.
The solution is to wrap the value in a CDATA block. But, I'm not
familiar enough with CoreDate to know if that is some setting
somewhere or an API call you need to make.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden