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 &
will fix the problem, but if i do that the link will be incorrect, how to fix this problem?
Thanks.
The data contains URL and read that data and bind to table. '>' is an unexpected token. The expected token is '"' or '''. Line 1, position 50. Any Body can Please share solution to me.
' ' is an unexpected token. The expected token is ';'. Line 1257, position 66. at System.Xml.XmlTextReaderImpl.Throw (Exception e) pageData is a custom object from another system, that is spitting out a datastream.
The expected token is ';'. Line 1544, position 46.) Details: [Binary] The issue is apparently with this line in the XML (and thereafter)
The expected token is ';' the error is in the Torrent attribute, its because the link contains & and replacing it with & will fix the problem, but if i do that the link will be incorrect, how to fix this problem? Thanks.
As it stands that is invalid XML. You will need to encode the &
as &
. When you read it out from your XML document, it will be just &
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With