Some values are creating exception during read of XML , I have catch one of them & , I want to know

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<p style="margin:0in 0in 10pt <span style="line-height:115%; font-family:Timesnewroman,serif; font-size:12pt I have an xml file.
<p style="margin:0in 0in 10pt <span style="line-height:115%; font-family:Timesnewroman,serif; font-size:12pt XML format:
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; font-size:12pt <span> <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt <?xml version=1.0?>
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt <SearchMails>
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt <Mails>
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt <Mail>
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt <FromAddres></FormAddress><ToAddress></ToAddress><CcAddress></CcAddress><Subject></Subject>
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt </Mail>
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt <Mail>
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt <FromAddres></FormAddress><ToAddress></ToAddress><CcAddress></CcAddress><Subject></Subject>
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt </Mail>
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt </SearchMails>
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:red; font-size:12pt When I read tag of this XML File In a structure array.It throw Exception
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#0070c0; font-size:12pt I compiled line by line And I found that code is throwing exception because of & sign.
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#0070c0; font-size:12pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#0070c0; font-size:12pt It was throwing exception because there was a & (ampersand) sign in subject tag.I replaced it then it was running fine.
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#0070c0; font-size:12pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#0070c0; font-size:12pt But suddenly I am getting again exception, It is another xml of above format.
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; font-size:12pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; font-size:12pt I want to know what type of condition where XML can throw exception.
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; font-size:12pt And all the parameter which are not allowed to write in XML
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt Please help me in this case , I will be thankful .
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt
<p style="line-height:normal; margin:0in 0in 0pt <span style="font-family:Timesnewroman,serif; color:#a31515; font-size:12pt
<p style="margin:0in 0in 0pt <span style="line-height:115%; font-family:Timesnewroman,serif; color:#a31515; font-size:12pt
<p style="margin:0in 0in 10pt <span style="line-height:115%; font-family:Timesnewroman,serif; font-size:12pt <span>

<br/>
<br/>

View the full article
 
Back
Top