Xml - '=' is an unexpected token, the expected token is ';'

kurdish gaming

i'm using this code to read a xml file

string xmlcontents = System.IO.File.ReadAllText("the xml path");
xml.LoadXml(xmlcontents);

when i execute this code it gives me this error

System.Xml.XmlException: ''=' is an unexpected token. The expected token is ';'

here is the xml line with the error

<SubMenu name="Assassins Creed Origins" picture="https://image.ibb.co/gqeqpd/image.jpg" Torrent="http://rarbg.to/download.php?id=hzvlmyb&f=The.Endless.2017.1080p.BluRay.H264.AAC-RARBG-[rarbg.to].torrent" />

the error is in the Torrent attribute, its because the link contains & and replacing it with &amp; will fix the problem, but if i do that the link will be incorrect, how to fix this problem?

Thanks.

Daniel A. White

As it stands that is invalid XML. You will need to encode the & as &amp;. When you read it out from your XML document, it will be just &.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related