Yes, HTMLCode should do the trick for you - but it's used when you output from the DB not input. You might want to fix the CMS so that I converts the characters prior to in input.
On Tue, Nov 16, 2010 at 5:11 AM, John Barrett <[email protected]> wrote: > > Hi Joel, > > Yeah I found out today that the boss was copying and pasting into the CMS > (really a CRUD system) I made. I had to go into the database and put the > correct html code for the quotes, I did it for one month, but there are like > 700 entries, this is not going to be fun fixing all that! > > I don't him if he must copy and paste to you a plain text editor, that > should stop the problem I hope. > > have you tried to use HTMLCodeFormat when writing to the database, I think > that works like XMLFormat if I am right? > I am looking here: > > http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000505.htm > > I did get everything working, now to convert the xml to RSS, got some > reading to do tonight, I am hoping to modify this template to generate RSS > feed instead of a XML file, then to use cfschudule to update the feed, not > sure if this is the best way, but that is my goal tonight. > > thanks so much for your help, > Johnny > > > > On Nov 15, 2010, at 5:06 AM, Joel Polsky wrote: > > > > > I've had the same problem with that question mark symbol before. For the > > data, are you cuting and pasting from Microsoft Word? Be sure to replace > > their curly quotes with an actual " or ' mark. > > > > If that still doesn't work try using & for a single and a " for > the > > double quotes IN the data. > > > > > > > > > > On Mon, Nov 15, 2010 at 3:07 AM, John Barrett <[email protected]> > wrote: > > > >> > >> Hi Joel, > >> thank so much! > >> > >> I wrote a blog about this: > >> http://hfug.net/?p=1867 > >> > >> The issue is the double quotes( ) and the apostrophe( ) so I used > >> XMLFormat by itself, and also wrapped it in a ![CDATA[ ]] block, but > >> nothing works. > >> The strange part in the cfdump, everything is fine, but when I write the > >> XML file I get errors for special characters. I thought that XMLFormat > >> handled the escaping special characters like "" ' < etc. > >> > >> The tip node looks like this now > >> <tip><![CDATA[#Trim(XMLFormat(getTips.dailytip))#]]></tip> > >> > >> I have converted db data into XML before, but never had this type of > issue, > >> I don't know where I am going wrong > >> thanks so much for your help > >> Johnny > >> On Nov 14, 2010, at 4:26 AM, Joel Polsky wrote: > >> > >>> > >>> Hi Johnny, > >>> > >>> It seems all ok to me...When I run the actual XML file in my browser I > >> get > >>> this error. > >>> Could there be an invalid charater in your data? > >>> > >>> > >>> An invalid character was found in text content. Error processing > resource > >> ' > >>> http://dl.dropbox.com/u/1775689/feed/tips_feed.x... > >>> > >>> <tip>Based on four studies conducted before 2007, the > >>> American Institute for Cancer Research stated th... > >>> > >>> > >>> > >>> On Sun, Nov 14, 2010 at 5:03 AM, John Barrett <[email protected]> > >> wrote: > >>> > >>>> > >>>> Hi, > >>>> I am having a problem using code(modified from the docs) to create a > XML > >>>> file. I use cfdump and everything looks good, but when I open the xml > >> file > >>>> is is corrupt. > >>>> > >>>> <!--- CF Code---> > >>>> > >>>> <cfquery name="getTips" datasource="my_datasource"> > >>>> SELECT > >>>> > tipdate,dailytip,consumer_link,consumer_text,research_link,research_text > >>>> FROM dailytips > >>>> ORDER BY tipdate DESC > >>>> </cfquery> > >>>> > >>>> <!--- Create an XML document object containing the data ---> > >>>> <cfxml variable="tipData"> > >>>> <data> > >>>> <cfoutput query="getTips"> > >>>> <dailytips> > >>>> <date>#DateFormat(tipdate, "mmmm d, yyyy")#</date> > >>>> <tip><![CDATA[#dailytip#]]></tip> > >>>> <consumerlink><![CDATA[<a > >>>> href='#consumer_link#'>#consumer_text#</a>]]></consumerlink> > >>>> <researchlink><![CDATA[<a > >>>> href='#research_link#'>#research_text#</a>]]></researchlink> > >>>> </dailytips> > >>>> </cfoutput> > >>>> </data> > >>>> </cfxml> > >>>> > >>>> <!--- dump the resulting XML document object ---> > >>>> <cfdump var=#tipData#> > >>>> <!--- Write the XML to a file ---> > >>>> <cffile action="write" file="mylocal_directory/feed/tips_feed.xml" > >>>> output=#toString(tipData)#> > >>>> > >>>> I added a CDATA blog to the tip node, thisnking that this was the > issue, > >>>> but it did not fix this. I am really lost on this. > >>>> > >>>> Image of cfdump: > >>>> http://dl.dropbox.com/u/1775689/feed/cf_dump.png > >>>> image of xml error: > >>>> http://dl.dropbox.com/u/1775689/feed/xml_error.png > >>>> image of xml file: > >>>> http://dl.dropbox.com/u/1775689/feed/xml_file.png > >>>> > >>>> the xml file : > >>>> http://dl.dropbox.com/u/1775689/feed/tips_feed.xml > >>>> > >>>> The issue is on some of the tip nodes(not all of them) it wraps to the > >> next > >>>> line. > >>>> > >>>> My main goal is to create RSS feed from the database, but I am just > >>>> learning RSS now, so I want to create a XL version first. > >>>> > >>>> Thanks so much, > >>>> Johnny > >>>> > >>>> > >>> > >>> > >> > >> > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5147 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm
