Solved

Response write xml from XmlDataDocument

Posted on 2009-03-31
2
533 Views
Last Modified: 2012-05-06
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

0
Comment
Question by:NickMalloy
2 Comments
 
LVL 14

Accepted Solution

by:
jjardine earned 250 total points
ID: 24035325
YOu may want to use a literal control instead of the label if you want to use that to output the transform.  Is this just a small piece of the page or the entire page?
0
 

Author Comment

by:NickMalloy
ID: 24039695
It is just a small piece. What I want to see is that Actual XML being produced. Not the transformation.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now