Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

I am getting ASP error  xmlParseEntityRef: no name. Anyone can help ?

Posted on 2016-09-29
1
Medium Priority
?
97 Views
Last Modified: 2016-10-03
<%
response.ContentType="text/xml"
Response.Charset = "utf-8"
Response.CodePage = 65001
%>
<!-- #include file="../includes/cnf.asp" -->
<%

%>

<%

mySQL =  "select * from MEDICAL order by MED_name   "

rs.CursorLocation = 3
rs.open mySQL, myCon, 0, 1
                                          
                                          
                                          if not rs.eof then
                                          
                                                response.write("<?xml version='1.0' encoding='UTF-8'?>")
response.write("<hospital-clinics>")
                                    
                                                while not rs.eof and rowcount < 100
                                    
                                          
                                          
                              MED_name = rs("MED_name")
                              
      MED_name = Replace(MED_name , "&rsquo;" , "'")
                              
      
            
                                          
            MED_DESC = rs("MED_DESC")
MED_DESC= Replace(MED_DESC , "lsquo" , "")
MED_DESC= Replace(MED_DESC , "&" , "")
MED_DESC= Replace(MED_DESC , "rsquo;" , "'")
MED_DESC= Replace(MED_DESC , "rsquo;" , "'")
MED_DESC= Replace(MED_DESC , "ldquo;" , """")
MED_DESC= Replace(MED_DESC , "rdquo;" , """")
MED_DESC= Replace(MED_DESC , "amp;", "&#038;")
MED_DESC= Replace(MED_DESC , "#39;" , "'")
MED_DESC= Replace(MED_DESC , "nbsp;" , " ")
MED_DESC= Replace(MED_DESC, "ndash;" , "-")
MED_DESC= Replace(MED_DESC, "quot;" , """")

 MED_LOCATION = rs("MED_LOCATION")
 

 
MED_LOCATION= Replace(MED_LOCATION , "lsquo" , "")
MED_LOCATION= Replace(MED_LOCATION , "&" , "")
MED_LOCATION= Replace(MED_LOCATION , "rsquo;" , "'")
MED_LOCATION= Replace(MED_LOCATION , "ldquo;" , """")
MED_LOCATION= Replace(MED_LOCATION , "rdquo;" , """")
MED_LOCATION= Replace(MED_LOCATION, "ndash;" , "-")
MED_LOCATION= Replace(MED_LOCATION, "quot;" , """")



               MED_TEL = rs("MED_TEL")
               
 MED_TEL= Replace( MED_TEL , "lsquo" , "")
 MED_TEL= Replace( MED_TEL , "&" , "")
 MED_TEL= Replace( MED_TEL , "rsquo;" , "' ")
 MED_TEL= Replace( MED_TEL , "ldquo;" , """")
 MED_TEL= Replace( MED_TEL , "rdquo;" , """")
 MED_TEL= Replace( MED_TEL, "ndash;" , "-")
 MED_TEL= Replace(  MED_TEL, "quot;" , """")

               
               

MED_EMAIL= rs("MED_EMAIL")
MED_WEBSITE= rs("MED_WEBSITE")


                                    

response.write("<medical-detail>")
'response.write("<newsid>" & rs("news_id") & "</newsid>")
response.write("<name>" & MED_name&   "</name>")
'response.write("<number>" & MED_TEL & "</number>")

response.write("<location>" & MED_LOCATION & "</location>")
response.write("<Description>" & MED_DESC & "</Description>")
'response.write("<website>" & MED_WEBSITE & "</website>")
'response.write("<email>" & MED_EMAIL & "</email>")
response.write("</medical-detail>")


            %>
       
       
       
          <%
                  count = count + 1
                  rowcount = rowcount + 1      
                  rs.MoveNext
            
                  Wend
                  
                  %>
            <%
            end if
            rs.close
            response.write("</hospital-clinics>")
            %>
0
Comment
Question by:Nikita Sharma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 33

Accepted Solution

by:
Big Monty earned 2000 total points
ID: 41821623
found this article online

you most likely have an & somewhere in your xml, either remove it or use the Server.HTMLEncode() function on it
1

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question