Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > creating an rss.xml file dynamically has issues

Reply
Thread Tools

creating an rss.xml file dynamically has issues

 
 
Astra
Guest
Posts: n/a
 
      03-06-2006
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


 
Reply With Quote
 
 
 
 
Mike Brind
Guest
Posts: n/a
 
      03-06-2006

Astra wrote:
> 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


No - you don't have to escape all non-alphanumeric characters, just the
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,"<","&lt;")
text = replace(text,">","&gt;")
tidyxml = text
End function

--
Mike Brind

 
Reply With Quote
 
 
 
 
Astra
Guest
Posts: n/a
 
      03-06-2006
Many thanks Mike

"Mike Brind" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...

Astra wrote:
> 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


No - you don't have to escape all non-alphanumeric characters, just the
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,"&","&amp;")
text = replace(text,"'","'")
text = replace(text,"'","'")
text = replace(text,""","""")
text = replace(text,""","""")
text = replace(text,"-","-")
text = replace(text,"<","&lt;")
text = replace(text,">","&gt;")
tidyxml = text
End function

--
Mike Brind


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating a html or jsp file dynamically KK Java 3 07-25-2008 09:07 PM
Dynamically creating .xls file. =?Utf-8?B?QXNoYQ==?= ASP .Net 2 06-30-2004 01:50 PM
Dynamically creating .xls file. =?Utf-8?B?QXNoYQ==?= ASP .Net 0 06-30-2004 05:49 AM
Dynamically creating a .js file to be included in response Ron Vecchi ASP .Net 5 10-22-2003 02:36 PM



Advertisments