I am trying to open an XSL file on via the following code
try
{
string XSLT = "c:\\sytlesheet.xsl";
string strXML = "c:\\xmlsourcefile.xml";
StringBuilder sb = new StringBuilder();
TextWriter tw = File.CreateText("c:\\OUTPUTFILE.txt");
new StringWriter(sb);
XslTransform xslt = new XslTransform();
xslt.Load(XSLT);
XPathDocument xp = new XPathDocument(strXML);
xslt.Transform(xp,null,tw);
return sb.ToString();
}
catch(Exception e)
{
throw e;
}
The code always fails on the xslt.Load(XSLT) line with the error
An unhandled exception of type 'System.Xml.Xsl.XsltCompileException' occurred in ...
This is a windows app if that makes a difference.
Does anyone have any ideas why the code might not be working? Any help would be much appriciated.
try
{
string XSLT = "c:\\sytlesheet.xsl";
string strXML = "c:\\xmlsourcefile.xml";
StringBuilder sb = new StringBuilder();
TextWriter tw = File.CreateText("c:\\OUTPUTFILE.txt");
new StringWriter(sb);
XslTransform xslt = new XslTransform();
xslt.Load(XSLT);
XPathDocument xp = new XPathDocument(strXML);
xslt.Transform(xp,null,tw);
return sb.ToString();
}
catch(Exception e)
{
throw e;
}
The code always fails on the xslt.Load(XSLT) line with the error
An unhandled exception of type 'System.Xml.Xsl.XsltCompileException' occurred in ...
This is a windows app if that makes a difference.
Does anyone have any ideas why the code might not be working? Any help would be much appriciated.