There is an xml file. Which I am trying to print as a table. However, when I try to view the file it gives this error:

error on line 32 at column 10: EntityRef: expecting ';' 

This line contains:

 <name>C&C Адвентэч Гель для умывания 150мл</name> 

That is, the system swears at C&C taking it by code and highlighting it in blue. If I delete, then everything is in order. But the problem is that the file is quite large and there are many such signs. Is there any way to ignore this character? Another interesting fact is that it swears only if I try to create an xml file on my local host. Online version works without problems. But the problem is that I can't get the file online.

The function used to get the link:

 function loadXMLDoc() { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { myFunction(this); } }; xmlhttp.open("GET", "1011.xml", true); xmlhttp.send(); } 

That is, in this line mlhttp.open("GET", "1011.xml", true); if just the 1011.xml file on the local host is working,

But if so mlhttp.open("GET", "http://provizor.tk/up/1011.xml", true); then nothing happens

  • The server gives you this line in the form <name>C&amp;C ... , so everything works correctly. and in the local file you have <name>C&C ... The XML parser, when encountering the & character, expects it to begin with the html entity, and is surprised to find no closing character ; what, in fact, reports. - Yaant
  • @Yaant I understand that, but what can I do with a local file that is the question? or how can I display a link from the server? - Yevgeniy Bagackiy
  • If there are no html entities in the file, then any suitable tool can be used to globally replace the & symbol with &amp; . If there is, then everything, of course, is somewhat more complicated, although, probably, it will also be possible to get by with some kind of regular expressions. And what exactly is your problem with accessing the server, it is not clear from the question. Any errors are written to the console? Or, under the debugger, see what status comes to onreadystatechange (perhaps, for some reason, there is not 200). - Yaant
  • @Yaant did just that. Replaced character. Now I understand that the problem is not at all that the local file or not. Since now and with the local file problem. There are no errors, after pressing the button, nothing happens. When I cut a file by several thousand, it starts working. It is necessary to increase and again nothing happens after pressing the button - Yevgeniy Bagackiy

0