![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Runtime detected an invalid program Runtime detected an invalid programTo: NULL Date: 12/11/2006 10:25:00 PM
I am transforming xml using the following function:
private static string transform(string xml, XsltArgumentList xslArg)
{
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(new XmlTextReader(new
MemoryStream(ASCIIEncoding.Default.GetBytes(Resource1.MacObjectToApi3))));
StringBuilder result = new StringBuilder();
StringReader sr = new StringReader(xml);
XmlReaderSettings settings = new XmlReaderSettings();
XmlReader reader = XmlReader.Create(sr, settings);
xslt.Transform(reader, xslArg, new StringWriter(result));
return result.ToString();
}
I am running Windows 2003 and .Net 3.0.
I get the following error:
System.InvalidProgramException was unhandled
Message="Common Language Runtime detected an invalid program."
Source="System.Xml.Xsl.CompiledQuery.1"
StackTrace:
at <xsl:template match="/">(XmlQueryRuntime
{urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator
{urn:schemas-microsoft-com:xslt-debug}current)
at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at Execute(XmlQueryRuntime
{urn:schemas-microsoft-com:xslt-debug}runtime)
at System.Xml.Xsl.ExecuteDelegate.Invoke(XmlQueryRuntime runtime)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument,
XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter
results)
at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument,
XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer,
Boolean closeWriter)
at System.Xml.Xsl.XmlILCommand.Execute(XmlReader contextDocument,
XmlResolver dataSources, XsltArgumentList argumentList, TextWriter results)
at System.Xml.Xsl.XslCompiledTransform.Transform(XmlReader input,
XsltArgumentList arguments, TextWriter results)
at XsltConsoleApplication.Program.transform(String xml,
XsltArgumentList xslArg) in C:\Documents and Settings\Administrator\My
Documents\Visual Studio
2005\Projects\XsltConsoleApplication\XsltConsoleApplication\Program.cs:line 42
at XsltConsoleApplication.Program.Main(String[] args) in C:\Documents
and Settings\Administrator\My Documents\Visual Studio
2005\Projects\XsltConsoleApplication\XsltConsoleApplication\Program.cs:line 23
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
The XSLT is fairly large. I have found by trial and error that I can remove
various <xsl:if test=".."> tests and get it to work.
Any idea what is causing the invalid program error or how to track it down?
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
