I have a below xml file.
<?xml version="1.0" encoding="iso-8859-1"?>
<bcreport created="20-Jun-2020 6:28:13 PM">
<filecomparison created="20-Jun-2020 6:28:12 PM">
<filename1>\\PC3\D\test1.bas</filename1>
<filename2>\\PC3\D\test2.bas</filename2>
<linecomp status="same">
<text ltid="1" rtid="1">Attribute VB_Name = "test"</text>
</linecomp>
<linecomp status="same">
<text ltid="2" rtid="2"> If Trim(RRRnum) "" Then RRRnum = RRRnum & "|"</text>
</linecomp>
<linecomp status="same">
<text ltid="3" rtid="3">'to remove special chars like &Amp;-case sensitive</text>
</linecomp>
</filecomparison>
</bcreport>
Here '&' in line "If Trim(RRRnum) "" Then RRRnum = RRRnum &" is the special character.
And '&Amp;' in line "to remove special chars like &-case sensitive" is not a special character.
The code used for reading xml file.
<?xml version="1.0" encoding="iso-8859-1"?>
<bcreport created="20-Jun-2020 6:28:13 PM">
<filecomparison created="20-Jun-2020 6:28:12 PM">
<filename1>\\PC3\D\test1.bas</filename1>
<filename2>\\PC3\D\test2.bas</filename2>
<linecomp status="same">
<text ltid="1" rtid="1">Attribute VB_Name = "test"</text>
</linecomp>
<linecomp status="same">
<text ltid="2" rtid="2"> If Trim(RRRnum) "" Then RRRnum = RRRnum & "|"</text>
</linecomp>
<linecomp status="same">
<text ltid="3" rtid="3">'to remove special chars like &Amp;-case sensitive</text>
</linecomp>
</filecomparison>
</bcreport>
Here '&' in line "If Trim(RRRnum) "" Then RRRnum = RRRnum &" is the special character.
And '&Amp;' in line "to remove special chars like &-case sensitive" is not a special character.
The code used for reading xml file.
Dim reader As XmlTextReader = New XmlTextReader("D:\file_1.xml") reader.EntityHandling = EntityHandling.ExpandEntities Dim xDoc As XmlDocument = New XmlDocument() xDoc.Load(reader) Dim nodeReader As XmlNodeReader = New XmlNodeReader(xDoc) DtXmlTbl.ReadXml(nodeReader) nodeReader.Close()
But i will get a error:Reference to undeclared entity 'AMP'.
How to solve this error?