Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi

i am reading a xml file iam pasting the part of it

XML
<Command>CHECK</Command>
            <ECUSignalName></ECUSignalName>
            <ECUSignalValue>KeyPosition1 == KeyPosition1&&Sleep_flag2 == Sleep_flag2&&</ECUSignalValue>
            <ECUSignalComment></ECUSignalComment>

but when it com to readin this
line
KeyPosition1 == KeyPosition1&&Sleep_flag2 == Sleep_flag2&&

it throwing error..
An error occurred while parsing EntityName
please help me on this
iam using
xmlReader.ReadElementContentAsString();
this for reading
Posted
Comments
Richard MacCutchan 22-Jan-14 7:10am    
The & characters need to be escaped as &amp;, or enclosed in a <![CDATA[ ... ]]> block.
Karthik_Mahalingam 22-Jan-14 7:11am    
post your c# code..

1 solution

The reason you are getting this issue is because & is a special character in XML. It indicates an escape sequence, so it normally precedes things like &lt; and the likes. You will either have to wrap this value in a CDATA, or you will have to convert each & into &amp;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900