Hey All,
I have a string that contains XML content and I want to transform it
in new XML content string.
What is the best way of doing this?
private string DoXSLTransform(string aXSLFileName, string
sOrigXMLContent)
{
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(aXSLFileName);
//copy my string into the XmlTextReader
XmlTextReader readerOrigContent =
new XmlTextReader(new
MemoryStream(ASCIIEncoding.Default.GetBytes(sOrigX MLContent)));
//create my stream for the result
Stream resultStream;
//do the transformation
xslt.Transform(readerOrigContent, null, resultStream);
//copy my stream into the StreamReader so I can get the string
StreamReader readerResult = new StreamReader(resultStream);
//get the resuling xml file as a string
return readerResult.ReadToEnd();
}
TIA!
~GINA_M~