HELP!!! REgEx, XML and a Qutation Mark
I am trying to export our product list to an XML feed. It works pretty well except that one of the products, has a quotation mark in it that nothing seems to like. I believe it is a cut and past issue and that the quotation mark is a special character. It is this one right here â No matter what I do I cannot get rid of this thing. And if I do search in the resulting file, I cannot search for a because it is not the same. I am doing this, and that is not getting rid of it... cfset title = REReplaceNoCase(title,(.|\n)*?â,,ALL) / cfset title = REReplace(title, [^0-9a-zA-Z_], , ALL) / and I am wrapping the tag like this... title![CDATA[ #Trim(XmlFormat(title))# ]]/title What else can I do, besides go into the database and delete it. I would like a code solution. Thanks in advance. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338778 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: HELP!!! REgEx, XML and a Qutation Mark
I am trying to export our product list to an XML feed. It works pretty well except that one of the products, has a quotation mark in it that nothing seems to like. It is this one right here ââ¬Â I believe that's a fancy quote likely pasted from Word or some other word processing application. Change the quote in the database to a standard ascii character and the XMLFormat() should pick it up and change it to the character entity in the output (which should eliminate the need for the CDATA block as well. Alternately, if you switch the character encoding modes and the encoding of your XML file to UTF-8 all around (and the application you're importing to properly supports Unicode) then that may also allow the character to remain without error. -Justin Scott ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338779 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm