Hi!
I am using the saxon-he in visual studio (as nuget package) for executing a Schematron Validation for an .xml document. saxon-he is working fine - Transformation is done correct but very very slow.
The reason is, that there is occurring a "first chance exception of type 'org.apache.xerces.impl.XMLEntityScanner$1 in saxon9he.dll" in following part of the code:
Processor processor = null;
XdmNode input = null;
XsltTransformer transformer = null;
try
{
processor = new Processor();
input = processor.NewDocumentBuilder().Build(new Uri(sourceFileName)); //A first chance exception of type 'org.apache.xerces.impl.XMLEntityScanner$1' occurred in saxon9he.dll
}
catch (Exception e)
{
logError(e);
}
try
{
var xsltCompiler = processor.NewXsltCompiler();
transformer = xsltCompiler.Compile(new Uri(xslFileName)).Load(); // A first chance exception of type 'org.apache.xerces.impl.XMLEntityScanner$1' occurred in saxon9he.dll
transformer.InitialContextNode = input; } catch (Exception e) { logError(e); } try { Serializer serializer = new Serializer(); using (StreamWriter outputWriter = new StreamWriter(resultFileName)) { serializer.SetOutputWriter(outputWriter); transformer.Run(serializer); } }
Any ideas why this execption is produced and how i can prevent?
Anonymous
It looks like we've seen it before and failed to get to the bottom of it on that occasion: https://sourceforge.net/p/saxon/mailman/message/28996720/
I should think it's some problem with entity or character references in your source document, or perhaps an encoding issue.