xml ファイルをデータセットにパラシングしています。xml データに「&」または特別な文字が含まれているとエラーが発生します。それを削除するにはどうすればよいですか?
タグの下の「&」を削除するにはどうすればよいですか?
xml
< department departmentid=1 name="pen & Note" >
$
string departmentpath = HostingEnvironment.MapPath("~/App_Data/Department.xml");
DataSet departmentDS = new DataSet();
System.IO.FileStream dpReadXml = new System.IO.FileStream(departmentpath, System.IO.FileMode.Open);
try
{
departmentDS.ReadXml(dpReadXml);
}
catch (Exception ex)
{
//logg
}