I have a XML like
<XYZ>front0
and</XYZ>
when I save text in xml it save exactly like whatever I type..but when I fetch from XML then it display in one line.. what is the problem?? any suggestion plz
UPDATE
XmlDocument xd = new XmlDocument();
string LastModifiedByTrans = "";
string date = "";
string LastModifiedByQaed = "";
string QAed_date = "";
try
{
foreach (var g in gp)
{
p.text = g.Text_xml.ToString();
// LOAD TEXT XML
xd.LoadXml(p.text);
XmlNodeList txt = xd.GetElementsByTagName("Texts");
for (int i = 0; i < txt.Count; i++)
{
XmlNode nd = txt.Item(i);
if (nd.HasChildNodes)
{
XmlNodeList cnd = nd.ChildNodes;
foreach (XmlNode n in cnd)
{
cont = n.ChildNodes[0].InnerText;
..
by innerText I fetch XML value ..
its like
n.ChildNodes[0].InnerText; "front0 and \r\n\r\nsaid can " string
but when I display it in div tag it shows in single line
UPDATE
public List<Room> getText(decimal Trans_ID, decimal Job_ID, string GroupName, string path)
{
GroupData p = new GroupData();
Room newroom = new Room();
var room = new List<Room>();
XmlDocument xd = new XmlDocument();
string LastModifiedByTrans = "";
string date = "";
string LastModifiedByQaed = "";
string QAed_date = "";
try
{
var gp = (from Trans_Mast in r2ge.Transcription_Master where Trans_Mast.Transcription_Id == Trans_ID && Trans_Mast.Entity_Id == Job_ID select Trans_Mast).Distinct();
foreach (var g in gp)
{
p.text = g.Text_xml.ToString();
// LOAD TEXT XML
xd.LoadXml(p.text);
XmlNodeList txt = xd.GetElementsByTagName("Texts");
for (int i = 0; i < txt.Count; i++)
{
XmlNode nd = txt.Item(i);
if (nd.HasChildNodes)
{
XmlNodeList cnd = nd.ChildNodes;
if (role == "Transcriber")
{
foreach (XmlNode n in cnd)
{
if (GroupName == n.Attributes["group"].Value && n.Attributes["audio"].Value.Equals(path) && n.Attributes["role"].Value.Equals("QA"))
{
LastModifiedByQaed = n.Attributes["user"].Value;
if (((n.Attributes["datetime"]).Value).Length > 0)
{
QAed_date = Convert.ToDateTime(n.Attributes["datetime"].Value).ToString("yyyy/MM/dd HH:mm:ss");
}
else
QAed_date = "";
}
}
foreach (XmlNode n in cnd)
{
if (GroupName == n.Attributes["group"].Value && n.Attributes["audio"].Value.Equals(path))
{
string cont = "";
string contnt = "";
if ((n.ChildNodes).Count > 0)
{
cont = n.ChildNodes[0].InnerText;
contnt = cont.Replace(System.Environment.NewLine, "<br/>");
}
else
cont = "blank";
if (((n.Attributes["datetime"]).Value).Length > 0)
{
date = Convert.ToDateTime(n.Attributes["datetime"].Value).ToString("yyyy/MM/dd HH:mm:ss");
}
else
date = "";
Text text = new Text()
{
Content = cont,
LastModifiedOn = date,
LastModifiedBy = n.Attributes["user"].Value,
LastModifiedBy_Qaed = LastModifiedByQaed,
LastModifiedOn_Qaed = QAed_date
};
newroom.text.Add(text);
}
}
}
}
}
}
}
catch (Exception ex)
{
Console.Write("In fetch text data err", ex.Message);
throw ex;
}
room.Add(newroom);
return room;
}