• 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: Newb Question: escaping quotes in a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newb Question: escaping quotes in a string


  • Subject: Re: Newb Question: escaping quotes in a string
  • From: Ryan Britton <email@hidden>
  • Date: Fri, 27 Jan 2006 14:46:02 -0800

Take a look at CFXMLCreateStringByEscapingEntities().

http://developer.apple.com/documentation/CoreFoundation/Reference/ CFXMLTreeRef/Reference/reference.html#//apple_ref/doc/uid/20001235- CH1g-DontLinkElementID_2


On Jan 27, 2006, at 9:32 AM, lists wrote:

I'm constructing some XML by hand from a dictionary object (the formatting is important) and I'm stumped on something that's super simple... how to escape quotes in a string that I'm placing in the attributes of the XML I'm crafting...

The closest I've come is this:

[[fooarray objectAtIndex:i] stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]

Which in some aspects is overzealous, as it encodes spaces, which is not a requirement for my XML, and in other aspects insufficient as it does not HTML encode entities such as ampersands... Doubtless, I'm barking up the wrong tree. Can someone point me in the right direction?

Thanks in advance!

- Stephen Caudill
_______________________________________________
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

_______________________________________________ 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: 
 >Newb Question: escaping quotes in a string (From: lists <email@hidden>)

  • Prev by Date: Re: BEEP protocol
  • Next by Date: "Library" smart group in Core Data
  • Previous by thread: Newb Question: escaping quotes in a string
  • Next by thread: BEEP protocol
  • Index(es):
    • Date
    • Thread