Bug #4253
closed

IKVM.NET throws java.lang.NoClassDefFoundError: 'com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl'
100%
Description
.NET Framework 4.7, Saxon EE 9.9.1.4 When calling parse-xml-fragment:
` class Program { static Processor processor = new Processor(true);
static string xslt =
@"<xsl:transform version='3.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>" +
@" <xsl:template name='xsl:initial-template' > " +
@" <xsl:variable name='doc'>to je test</xsl:variable>" +
@" <xsl:sequence select='parse-xml-fragment($doc)'/>" +
@" </xsl:template>" +
@"</xsl:transform>";
static void Main(string[] args)
{
XsltCompiler xsltCompiler = processor.NewXsltCompiler();
xsltCompiler.XsltLanguageVersion = "3.0";
XsltExecutable exec = xsltCompiler.Compile(new StringReader(xslt));
Xslt30Transformer transf = exec.Load30();
Serializer ser = processor.NewSerializer();
StringWriter sw = new StringWriter();
ser.SetOutputWriter(sw);
transf.CallTemplate(null, ser);
Console.WriteLine(sw.ToString());
}
}`
Updated by O'Neil Delpratt about 4 years ago
- Category set to .NET API
- Assignee set to O'Neil Delpratt
- Applies to branch trunk added
Thanks for reporting this issue. We will investigate it and report back shortly.
Updated by O'Neil Delpratt about 4 years ago
- Status changed from New to In Progress
We have reproduced the error reported. This is indeed a bug. Related to the bug fix in the bug issue #4127.
This did slip through our maintenance release tests. What is happening here is the delegated XML parser used in parseXmlFragment is specifically the javax.xml.parsers.SAXParserFactory, which is not available in the .NET release. The fix here is to use the Xerces parser.
Working on the fix which will be available in the next maintenance release.
Updated by O'Neil Delpratt about 4 years ago
- Status changed from In Progress to Resolved
- % Done changed from 0 to 100
- Fix Committed on Branch 9.9, trunk added
Bug fixed and committed to subversion available for the next maintenance release.
Updated by O'Neil Delpratt about 4 years ago
- Status changed from Resolved to In Progress
Leave bug issue open until we have reinstated tests
Updated by O'Neil Delpratt about 4 years ago
I have added a test case for this bug issue to the nunit tests.
Updated by Michael Kay about 4 years ago
The current state of the code on the Java platform is that JAXP is always being used to find a parser for parse-xml-fragment(), which brings us back to bug #4127. I have changed the code in JavaPlatform so that it attempts to instantiate com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
when doing parse-xml-fragment()
, reverting to the JAXP-selected parser if the com.sun
one is not available (e.g with a non-Oracle JDK).
Updated by Michael Kay about 4 years ago
- Status changed from In Progress to Resolved
Marking as resolved
Updated by O'Neil Delpratt about 4 years ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 9.9.1.5 added
Bug fix applied in the Saxon 9.9.1.5 maintenance release.
Please register to edit this issue