Style XML document with XSL

FLCL

New Member
Hi,<BR><BR>I have an XmlDocument object that contains a well formed XML file (built on the fly and does not exist on disk).<BR><BR>I want to style it using an XSL stylesheet which I have created.<BR><BR>I've used the following code which works (docXML is my XmlDocument):<BR><BR>XslTransform docXsl = new XslTransform();<BR>docXsl.Load(Server.MapPath("results.xsl"));<BR><BR>docXsl.Transform(docXml,null,Response.Output)<BR><BR>The problem with this is that it outputs the styled XML straight away and I need to put it into a specific control or variable.<BR><BR>How can I do this? I've tried creating an XmlTextWriter but it keeps going on about abstract classes and stuff, which, given my current C# knowledge I don't fully understand.<BR><BR>Thanks very much for your help.<BR>Tom
 
Back
Top