473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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
Mar 6 '06 #1
2 1715

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

Mar 6 '06 #2
Many thanks Mike

"Mike Brind" <pa*******@hotmail.com> wrote in message
news:11**********************@j52g2000cwj.googlegr 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
Mar 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Billy Cormic | last post by:
Hello, I am interested in dynamically creating temp tables using a variable in MS SQL Server 2000. For example: DECLARE @l_personsUID int select @l_personsUID = 9842
24
by: jonathon | last post by:
Hi all, I have a web app with a popup window for entering data. I don't want to access the web every time this window is opened, as most of the app is AJAX. But I can't figure out how to open...
2
by: LIN | last post by:
Hello, Greetings. I am creating a web site which will contain lot of articles. I had been planning to create simple HTML page on the server everytime i posted a article (eg. article12.html )....
10
by: Ron Vecchi | last post by:
I am creating a custom web control that uses an enum for a property {Remote,InLine}. If the property is set to inline then text is read from the embedded resource and sent to the browser in the...
6
by: martin | last post by:
Hi, I have noticed that every aspx page that I created (and ascx file) has an assosiated resource file aspx.resx. However what I would like to do is have a single global resource file for the...
5
by: Praveen | last post by:
I have script files embedded as resources in my dll. During runtime, I would like to write it out into the app dir (or a app sub-dir) and send the appropriate virtual path to the client. This makes...
2
by: Eric Falsken | last post by:
Eric Falsken <eric@db4o.com> wrote on 04 Dec 2005: > craigkenisston@hotmail.com wrote on 19 Nov 2005: > >> I'm working in the migration of an asp.net application in 1.1 to 2.0. >> I'm new to...
5
by: laredotornado | last post by:
Hi, I'm using PHP 4.3. There is a section of my application in which I'd like users to be able to download a custom file. The file would be different for each user, so I was planning on...
5
by: SalamElias | last post by:
I am creating several chkBoxes dynamically and assigning an event handler in the Page_load as foillows ***************************** Dim chkCatOption As CheckBox = New CheckBox chkCatOption.Text...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.