Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASP XML problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ASP XML problem

 Post Reply Post Reply
Author
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post Topic: ASP XML problem
    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%>

Back to Top
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
MortiOli View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 May 2002
Location: United Kingdom
Status: Offline
Points: 514
Post Options Post Options   Thanks (0) Thanks(0)   Quote MortiOli Quote  Post ReplyReply Direct Link To This Post 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%>
Back to Top
ainsworth14 View Drop Down
Groupie
Groupie


Joined: 05 August 2003
Location: United Kingdom
Status: Offline
Points: 62
Post Options Post Options   Thanks (0) Thanks(0)   Quote ainsworth14 Quote  Post ReplyReply Direct Link To This Post 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%>

Back to Top
Jono View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jono Quote  Post ReplyReply Direct Link To This Post 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=" & cat_ID(x) & "&productdetail=" & ID(x)%></link>

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

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.