Print Page | Close Window

ASP XML problem

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=25087
Printed Date: 29 March 2026 at 3:11am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP XML problem
Posted By: ainsworth14
Subject: ASP XML problem
Date Posted: 02 January 2008 at 4:37pm
hi guys

I am trying to generate an RSS feed by using ASP script that cycles through all new items within a DB. the script works in that it does pull out what I want but the following code doesn't generate the correct URL within the <link> tag that links to the item page.

my generated page has the correct link of: /productpage.asp?category=1010&productdetail=100055

but once i have uploaded the xml file and read the feed in a reader the link is changed to

/productpage.asp?category=1010=100055

it doens't read the second querystring, any ideas why?

<%response.write "<item>"
   response.write "<title>"& artist(x) & " - " & title(x) & " (" & label(x) & ") &#163" & formatnumber(price(x)) &"</title>"
   response.write "<link> http://www.firstrhythm.co.uk/productpage.asp?category="&cat_ID(x) & "productdetail=" & ID(x) & "</link>"
   response.write "<description>"& desc(x)& " - " & " (" & page(x) & ")" & "</description>"
   response.write "</item>"
NEXT%>




Replies:
Posted By: ainsworth14
Date Posted: 02 January 2008 at 4:40pm
also my web development toolbar within firefox highlights productdetail in red and declares an error:

Warning: Unknown property 'filter'.  Declaration dropped.


Posted By: MortiOli
Date Posted: 03 January 2008 at 12:58pm
I'm no 'proper' coder, so apologies if this isn't correct, but should it be the following - looks to be missing an '&' sign;
 
 
<%response.write "<item>"
   response.write "<title>"& artist(x) & " - " & title(x) & " (" & label(x) & ") &#163" & formatnumber(price(x)) &"</title>"
   response.write "<link> http://www.firstrhythm.co.uk/productpage.asp?category="&cat_ID(x) & "&productdetail=" & ID(x) & "</link>"
   response.write "<description>"& desc(x)& " - " & " (" & page(x) & ")" & "</description>"
   response.write "</item>"
NEXT%>
 
 
Also, not sure it matters, but the spaces aren't consistant between;
 
"&cat_ID(x) & "
 
and
 
" & ID(x) & "
 
 
 
I'd write it as;
 
<%response.write "<item>"
   response.write "<title>"& artist(x) & " - " & title(x) & " (" & label(x) & ") &#163" & formatnumber(price(x)) &"</title>"
   response.write "<link> http://www.firstrhythm.co.uk/productpage.asp?category=" & cat_ID(x) & "&productdetail=" & ID(x) & "</link>"
   response.write "<description>"& desc(x)& " - " & " (" & page(x) & ")" & "</description>"
   response.write "</item>"
NEXT%>


Posted By: ainsworth14
Date Posted: 03 January 2008 at 1:37pm
Thanks for your reply

the missing & was just an oversight and doens't actually affect the problem
I have changed the code so it reads better and have discovered that i need to use &amp; to get an ampersand to show, trouble is that it now shows two of them!


<item>
   <title> <%=artist(x)%> - <%=title(x)%> ( <%=label(x)%> ) £ <%=formatnumber(price(x))%></title>
   <link>http://www.firstrhythm.co.uk/productpage.asp?category=<%=cat_ID(x)%>&amp;productdetail=<%=ID(x)%></link>
   <description><%=desc(x)%> <p></p> <%=page(x)%> </description>
   </item>
<%next%>



Posted By: Jono
Date Posted: 04 January 2008 at 4:26pm
There are several "reserved" characters in XML, including the ampersand (&) character. Try using the Server.HTMLencode() function to convert your URL that you want to include:
 
<link><%=Server.HTMLencode(" http://www.firstrhythm.co.uk/productpage.asp?category= - http://www.firstrhythm.co.uk/productpage.asp?category= " & cat_ID(x) & "&productdetail=" & ID(x)%></link>

 
You may also want to investigate the CDATA tag for XML which help with these characters.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net