hello all I hope you can help me out here. I have an xmlDocument xDoc with content in it already. I also have an xml file that I want to append to it. here is the function
The problem is that the footerText node above contains has innerXml like this:
"\r\n\t<section>\r\n\t\t<header>\r\n\t\t\tThis is the first header\r\n\t\t</header>\r\n\t\t<text>\r\n\t\t\tThis..." Then when I add it to the xDoc it keeps all the \r\n\t stuff... Any ideas?
Code:
private void addFooter(ref XmlDocument xDoc)
{
// Get the footer xml document and add it to the
// current xDoc (Session["XMLParts"])
string langDelimiter = Session["CurrentLanguage"].ToString().ToLower();
string filename = Server.MapPath("Reports/FooterText_" + langDelimiter + ".xml");
XmlTextReader reader = new XmlTextReader(filename);
reader.MoveToContent(); //Move to the cd element node.
//Create a node representing the footerText element node.
XmlNode footerText = xDoc.ReadNode(reader);
//Insert the new node into the document.
xDoc.DocumentElement.AppendChild(footerText);
}
The problem is that the footerText node above contains has innerXml like this:
"\r\n\t<section>\r\n\t\t<header>\r\n\t\t\tThis is the first header\r\n\t\t</header>\r\n\t\t<text>\r\n\t\t\tThis..." Then when I add it to the xDoc it keeps all the \r\n\t stuff... Any ideas?