My current code contains a hardcoded filename for the XmlTextWriter to write to, and then an XmlDocument loads that file. I am looking to replace the hardcoded filename with something, anything that will retain the contents that the XmlTextWriter outputs.
My code:
What can I replace "results.xm l" with? A Stream? BufferedStream? XmlWriter? I'm not sure what to do with it.
Andrew
My code:
Code:
XslCompiledTransform myXslTrans = new XslCompiledTransform();
myXslTrans.Load("sortByExtension.xsl");
XmlTextWriter XmlWrite = new XmlTextWriter("results.xml", null);
myXslTrans.Transform(tvXML, null, XmlWrite);
XmlWrite.Close();
XmlDocument sortedXML = new XmlDocument();
sortedXML.Load("results.xml");
return sortedXML;
Andrew
Comment