alla classe che avevo proposto QUI
cambiando un paio di funzioni:
:
public string newFromXslUri(string xml,string xsluri)
{
System.Xml.Xsl.XslTransform xt = new XslTransform();
xt.Load(xsluri);
XPathDocument xd = new XPathDocument(new System.IO.StringReader(xml));
System.Text.StringBuilder sb = new System.Text.StringBuilder();
xt.Transform(xd.CreateNavigator(),new System.Xml.Xsl.XsltArgumentList(),new System.IO.StringWriter(sb));
return sb.ToString();
}
public string newFromstr(string xml,string xsl)
{
System.Xml.Xsl.XslTransform xt = new XslTransform();
XPathDocument xs = new XPathDocument(new System.IO.StringReader(xsl));
xt.Load(xs.CreateNavigator());
XPathDocument xd = new XPathDocument(new System.IO.StringReader(xml));
System.Text.StringBuilder sb = new System.Text.StringBuilder();
xt.Transform(xd.CreateNavigator(),new System.Xml.Xsl.XsltArgumentList(),new System.IO.StringWriter(sb));
return sb.ToString();
}