Menu

.NET API - XmlEntityScanner exception on XsltCompiler compilation

saxon-help
2013-02-22
2013-02-23
  • Daniel Longest

    Daniel Longest - 2013-02-22

    I'm using the Saxon 9.4-HE library for .NET. When I try to compile the XsltCompiler into an XsltExecutable, I get this error:
    A first chance exception of type 'org.apache.xerces.impl.XMLEntityScanner$1' occurred in saxon9he.dll

    The code that leads to the error is:
    var processor = new Saxon.Api.Processor();
    var compiler = processor.NewXsltCompiler();
    compiler.ErrorList = new List<Saxon.Api.StaticError>();

           var executable = compiler.Compile(@"file:///C:/My/Xsl/shouldwork.xsl"); /// ERROR HERE
    

    The ErrorList property is not populated with any errors. The XSL file definitely exists at that location and the .NET Uri class considers it well-formed. I have used this same stylesheet in Altova to run transformations and it worked fine.

    Can someone suggest something I can try to troubleshoot this further?

    Daniel

     
    • Michael Kay

      Michael Kay - 2013-02-22

      Could I suggest you use the forums at saxonica.plan.io in future? This forum is rather dormant.

      I think the most likely explanation of the problem is an encoding error or other low-level error reading the file.