Simple XML to XML Transformation 2003, .net 1.1

My application is intended to receive xml data from a variety of sources.  Each xml data packet is loaded into an XmlDocument.

I now need to convert the xml in this XmlDocument object and load the result into a new XmlDocument. (XmlDoc -> XSLT -> NewXmlDoc)

 - The XSLT for this transform is located on a public server: ""
 - All xml data needs to be handled in memory, and not saved to the file system.

Does anyone have a completed example of this (in either c# or vb)?  I have struggled to find an example that doesn't involves the source xml being on the file system.

Who is Participating?
Hello SiJP,

you could use something along the lines of
   XPathDocument xmlInput = new XPathDocument(new StringReader(XML));
   XslTransform xsltProcessor = new XslTransform();
   xsltProcessor.Load(new XmlReader(new StringReader(XSL)));
 // parse the XML input and to load the XSLT stylesheet, then transform to a StringWriter
   StringWriter stringWriter = new StringWriter();
   xsltProcessor.Transform(xmlInput, null, stringWriter, null);

   // the stringwriter contains the resulting xml > stringWriter.ToString();

hope this helps a bit
SiJPAuthor Commented:
Apologies all - bruintje's aswer was great! - I've accepted this now

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.