No stylesheet loaded

I am using C # code on aspx pages to hide the pages of the xml infopath page in html. Here is my code:

XPathDocument myDoc = new XPathDocument(@"C:\Users\rameshgandhik\Documents\infopath forms\ram.xml");
XmlTextWriter myWr = new XmlTextWriter(@"C:\Users\rameshgandhik\Documents\infopath forms\ram.html",null);
XslTransform myXsl = new XslTransform();
myXsl.Transform(myDoc, null, myWr);    // Here i am getting an error.

The myWr in Transform method shows an error that Msgstr "No stylesheet loaded."

Does anyone have any ideas about this error ......... Please tell me the solution ....

+3
source share
1 answer

That would be because you did not load the stylesheet. :-)

You created a new object XslTransform, but in fact you did not enter any conversion rules. Therefore, he does not know how to convert the XML that you give him, which is quite clearly expressed in the error message.

*.xsl, XslTransform.Load.
, , , , , .

+3

Source: https://habr.com/ru/post/1796452/


All Articles