public static string Transform(string xmlData, string pathXsl)
{
string result;
//Carico l'XML in un
XmlDocument
XmlDocument doc = new XmlDocument();
doc.LoadXml(xmlData);
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(pathXsl);
//StringWriter(derivato
da TextWriter) per scrivere su stringa
*****
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
xslt.Transform(doc, null, sw);
return
sb.ToString();
}
|