NickMalloy
asked on
Response write xml from XmlDataDocument
I have an DS that I convert to XML and then use a XSLT to create a table. I can't figure out how to write out the actual XML that is being created. How would I do it?
public void CurrentBuilder()
{
vw_currents MyProject = new vw_currents();
DataSet ds = MyProject.getCurrents();
if (ds.Tables[0].Rows.Count > 0)
{
XmlDataDocument XMLDD = new XmlDataDocument(ds);
CreateDataTable(XMLDD, "../xslt/Admins.xslt", Convert.ToString(1), 3);
}
}
public bool CreateDataTable(XmlDataDocument XMLDD, string XSLTPath, string ID, int whichone)
{
bool WasComp = false;
try
{
System.IO.StringWriter MyString = new System.IO.StringWriter();
XslCompiledTransform XmlToHtml = new XslCompiledTransform();
XmlToHtml.Load(HttpContext.Current.Server.MapPath(XSLTPath));
XmlToHtml.Transform(XMLDD, null, MyString);
lblcheckin.Text = MyString.ToString();
WasComp = true;
}
catch (Exception ex)
{
throw (ex);
}
return WasComp;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER