Link to home
Start Free TrialLog in
Avatar of NickMalloy
NickMalloyFlag for United States of America

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;
    }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of jjardine
jjardine
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NickMalloy

ASKER

It is just a small piece. What I want to see is that Actual XML being produced. Not the transformation.