Bonjour je voudrais faire une transformation xslt en c#. J'arrive à effectuer cette transformation lorsque
le resultat est un fichier, mais lorsque je souhaite que le resultat soit de type string ca ne marche pas. Quelqu'un aurait il une idée?
voici le code
string sauv = string.Empty;
try
{
//Create a new XslTransform object.
XslTransform xslt = new XslTransform();
//Load the stylesheet.
xslt.Load(Server.MapPath("../Index/index.xsl" ));
//Create a new XPathDocument and load the XML data to be transformed.
XmlDocument xp = new XmlDocument();
xp.Load(Server.MapPath("../Index/index.xml" ));
//Create an XmlTextWriter which outputs to the console.
XmlTextWriter writer = new XmlTextWriter(html, null);
//Transform the data and send the output to the console.
xslt.Transform(xp, null, writer, null);
writer.Close();//la transformation xslt fonctionne
XmlReader filexml = xslt.Transform(xp, new XsltArgumentList(), new XmlUrlResolver());
int i=0;
while (!filexml.EOF)
{
sauv += ++i + " " + filexml.ReadOuterXml();
filexml.Read();
}//sauv est vide
}
catch(Exception e1)
{
toto.InnerHtml = e1.ToString();
}