我有以下代码行:
xslt.Load(XmlReader.Create(new StringReader(xslMarkup)));
xslt is of type XslCompiledTransfrom
和xslMarkup is a XDocument
。
运行我的代码我在输出窗口中得到以下消息的许多行(代码运行到最后,但仍然给我这个例外):
Exception thrown: 'System.Xml.Xsl.XPath.XPathCompileException' in System.Data.SqlXml.dll
所以我将代码行放在try catch块中
try
{xslt.Load(XmlReader.Create(new StringReader(xslMarkup)));}
catch (Exception e)
{MessageBox.Show(e.Message);}
但是在编译期间它不会进入catch块并将异常抛出到输出窗口。
1. Can anyone help me understanding the error, I just stuck here and cannot find any help?
2. Any ideas how I can get more information about the error?