Solved

Response write xml from XmlDataDocument

Posted on 2009-03-31
2
539 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

896 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

17 Experts available now in Live!

Get 1:1 Help Now