|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
creating an rss.xml file dynamically has issues
Hi All
Creating an rss.xml file dynamically via ASP/ADO/DB, but find errors in the file. Don't think it's an ASP prob to be honest. Think its more to do with the fact that the ampersands are accepted in the file. Do I take it that you have to 'escape' all non alphanumeric chars to produce a valid file? I thought xml files were supposed to eradicate the usual invalid char problems that tab-delimited and csvs used to have? Any ideas? Thanks Robbie Astra wrote:
Show quote > Hi All No - you don't have to escape all non-alphanumeric characters, just the> > Creating an rss.xml file dynamically via ASP/ADO/DB, but find errors in the > file. > > Don't think it's an ASP prob to be honest. Think its more to do with the > fact that the ampersands are accepted in the file. Do I take it that you > have to 'escape' all non alphanumeric chars to produce a valid file? > > I thought xml files were supposed to eradicate the usual invalid char > problems that tab-delimited and csvs used to have? > > Any ideas? > > Thanks > > Robbie ones that have special meaning in xml. Try this function for cleaning your strings up prior to outputting them to your rss.xml file: function tidyxml(text) text = replace(text,Chr(180),"'") text = replace(text,"&","&") text = replace(text,"'","'") text = replace(text,"'","'") text = replace(text,""","""") text = replace(text,""","""") text = replace(text,"-","-") text = replace(text,"<","<") text = replace(text,">",">") tidyxml = text End function -- Mike Brind Many thanks Mike
"Mike Brind" <paxton***@hotmail.com> wrote in message Astra wrote:news:1141657272.611399.295250@j52g2000cwj.googlegroups.com... Show quote > Hi All No - you don't have to escape all non-alphanumeric characters, just the> > Creating an rss.xml file dynamically via ASP/ADO/DB, but find errors in > the > file. > > Don't think it's an ASP prob to be honest. Think its more to do with the > fact that the ampersands are accepted in the file. Do I take it that you > have to 'escape' all non alphanumeric chars to produce a valid file? > > I thought xml files were supposed to eradicate the usual invalid char > problems that tab-delimited and csvs used to have? > > Any ideas? > > Thanks > > Robbie ones that have special meaning in xml. Try this function for cleaning your strings up prior to outputting them to your rss.xml file: function tidyxml(text) text = replace(text,Chr(180),"'") text = replace(text,"&","&") text = replace(text,"'","'") text = replace(text,"'","'") text = replace(text,""","""") text = replace(text,""","""") text = replace(text,"-","-") text = replace(text,"<","<") text = replace(text,">",">") tidyxml = text End function -- Mike Brind |
|||||||||||||||||||||||