First, please make sure you are using the latest version. In 9.4.0.2 we picked up a new IKVMC release which fixed some bugs that affected code generation in 9.4.0.1.

If the problem remains, please send is your stylesheet so we can try and reproduce the problem here.

Best regards,

Michael Kay
Saxonica


On 16/03/2012 14:24, Aleksandrs Zeļikovičs wrote:

Hello,

 

We try SaxonEE9.4N\bin for .net application,

If I use it on Console application all works fine,

But if I use WindowsApplication, web-service, or another .Net Project type it throw Exception:

 

com.saxonica.bytecode.map.CompiledContextMappingFunction

Source: IKVM.Runtime

 

Code:

 

Processor proc = new Processor();

            IList errors = new ArrayList();

            XsltCompiler compiler = proc.NewXsltCompiler();

 

            try

            {

                compiler.BaseUri = new Uri("c:\\xslt.xslt");

                compiler.SchemaAware = false;

                compiler.ErrorList = errors;

                XsltTransformer trans = compiler.Compile(reader).Load();

            }

            catch (StaticError e)

            {

                StringBuilder sb = new StringBuilder();

                sb.AppendLine("XML transformation validation Error:" + e.Message + "error:");

 

                int cc = 1;

                if (compiler.ErrorList != null && compiler.ErrorList.Count > 0)

                {

                    foreach (Saxon.Api.StaticError item in compiler.ErrorList)

                    {

                        sb.AppendLine(cc.ToString() + ": " + item.Message);

                        cc++;

                    }

                }

                throw new XmlValidationException(sb.ToString());

 

            }

            catch (Exception e)

            {

                if (e.GetType().Name.Contains("TransformerConfigurationException"))

                {

                    StringBuilder sb = new StringBuilder();

                    sb.AppendLine("XML transformation validation Error:" + e.Message + "error:");

 

                    int cc = 1;

                    if (compiler.ErrorList != null && compiler.ErrorList.Count > 0)

                    {

                        foreach (Saxon.Api.StaticError item in compiler.ErrorList)

                        {

                            sb.AppendLine(cc.ToString() + ": " + item.Message);

                            cc++;

                        }

                    }

                    throw new XmlValidationException(sb.ToString());

                }

                else

                {

                    throw;

                }

            }