I am trying to build an XML file from a JSON feed and it works great until my client started using "quotes" in a photo caption which the feed sends to my script.
I am accessing the JSON feed from Facebook for a photo album and can't ask my client to NOT use quotes in their photo descriptions. It would be the easy answer to this, but not practical.
With the feed I get, I use the below code to clean up the feed (per the ColdFusion site suggestion) I added the last line of REReplace() to try and remove the quotes within the photo descriptions, but it isn't working. The problem is that when the script finds a photo where the description (caption) has quotes in it, it simply stops my site from displaying the photos is gets from the feed because the XML file keeps the additional quotes in there and it breaks the script.
My cleanup code from the feed:
<cfset theData=REReplace(theData, "\s*\)\s*$", "")>
The resulting XML with a proper formatted and improper formatted result (notice the TITLE field results):
<pic image="http://sphotos-b.xx.fbcdn.net/hphotos-ash3/s480x480/558468_340698272689957_769834684_n.jpg" title="Rock the Arts Park Poster; Save the SkyVue Concert August 2012...Thank you New Castle, Indiana....You Rock! - Emma Petts Music" link="" link_title="" target="_self"/>
<pic image="http://sphotos-a.xx.fbcdn.net/hphotos-ash4/s480x480/480827_340582309368220_853375246_n.jpg" title="Emma Live At " Save the Vue" SkyVue Concert. Sunday August 24, 2012 as she appeared with Benito for the benefit concert in New Castle, Indiana. (Eric Cox/ Knightstown Banner) - Emma Petts Music" link="" link_title="" target="_self"/>
They put quotes around SAVE THE VUE, which would aesthetically be correct in Facebook, but messes up my JSON feed to their website. It essentially only displays the photos up until the one that is messed up.
So how do I strip out their quotes?