Actions
Bug #6370
closedXSD based validation finds a validation error but hits a NullPointerException when trying to generate a validation report
Start date:
2024-03-06
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
12, trunk
Fix Committed on Branch:
12, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java
Description
When I try to run Saxon Java 12.4 EE or SaxonCS 12.4 from the command line to validate the attached XML against the attached XSD schema, the validation error is found fine.
However, when I try to use -report:report.xml
to have Saxon generate a validation report, it fails with java.lang.NullPointerException for Saxon EE Java and System.NullReferenceException for SaxonCS.
Stack trace Saxon 12.4 Java EE:
java.lang.NullPointerException
at com.saxonica.ee.validate.InvalidityReportGeneratorEE.reportInvalidity(InvalidityReportGeneratorEE.java:168)
at com.saxonica.ee.validate.SelectorWatch.reportValidationError(SelectorWatch.java:601)
at com.saxonica.ee.validate.SelectorWatch.checkRow(SelectorWatch.java:269)
at com.saxonica.ee.validate.KeySelectorWatch.checkRow(KeySelectorWatch.java:49)
at com.saxonica.ee.validate.SelectorWatch.endSelectedParentNode(SelectorWatch.java:107)
at com.saxonica.ee.stream.watch.WatchManager.endElement(WatchManager.java:544)
at net.sf.saxon.event.TeeOutputter.endElement(TeeOutputter.java:145)
at net.sf.saxon.event.TeeOutputter.endElement(TeeOutputter.java:144)
at net.sf.saxon.event.ProxyReceiver.endElement(ProxyReceiver.java:149)
at com.saxonica.ee.validate.EmptyContentValidator.endElement(EmptyContentValidator.java:155)
at com.saxonica.ee.validate.ValidationStack.endElement(ValidationStack.java:490)
at net.sf.saxon.event.ProxyReceiver.endElement(ProxyReceiver.java:149)
at net.sf.saxon.event.ProxyReceiver.endElement(ProxyReceiver.java:149)
at com.saxonica.ee.validate.AttributeInheritor.endElement(AttributeInheritor.java:63)
at net.sf.saxon.event.PathMaintainer.endElement(PathMaintainer.java:60)
at net.sf.saxon.event.DocumentValidator.endElement(DocumentValidator.java:79)
at net.sf.saxon.event.ReceivingContentHandler.endElement(ReceivingContentHandler.java:578)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:610)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:184)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:351)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
at net.sf.saxon.resource.ActiveSAXSource.deliver(ActiveSAXSource.java:192)
at net.sf.saxon.event.Sender.send(Sender.java:104)
at com.saxonica.ee.s9api.SchemaValidatorImpl.validate(SchemaValidatorImpl.java:624)
at com.saxonica.Validate.processFile(Validate.java:603)
at com.saxonica.Validate.doValidate(Validate.java:421)
at com.saxonica.Validate.main(Validate.java:56)
Stack trace SaxonCS 12.4:
System.NullReferenceException: Object reference not set to an instance of an object.
at Saxon.Eej.ee.validate.InvalidityReportGeneratorEE.reportInvalidity(Invalidity failure)
at Saxon.Eej.ee.validate.SelectorWatch.reportValidationError(ValidationFailure err, Location locator)
at Saxon.Eej.ee.validate.SelectorWatch.checkRow(AtomicSequence[] currentRow, Boolean isTarget, Location locationId)
at Saxon.Eej.ee.validate.KeySelectorWatch.checkRow(AtomicSequence[] currentRow, Boolean isTarget, Location locationId)
at Saxon.Eej.ee.validate.SelectorWatch.endSelectedParentNode(Location locationId)
at Saxon.Eej.ee.stream.watch.WatchManager.endElement()
at Saxon.Hej.event.TeeOutputter.endElement()
at Saxon.Hej.event.TeeOutputter.endElement()
at Saxon.Eej.ee.validate.EmptyContentValidator.endElement()
at Saxon.Eej.ee.validate.ValidationStack.endElement()
at Saxon.Hej.event.ProxyReceiver.endElement()
at Saxon.Eej.ee.validate.AttributeInheritor.endElement()
at Saxon.Hej.event.PathMaintainer.endElement()
at Saxon.Hej.event.DocumentValidator.endElement()
at Saxon.Hej.pull.PullPushTee.copyEvent(PullEvent event)
at Saxon.Hej.pull.PullPushTee.next()
at Saxon.Hej.pull.PullPushCopier.copy()
at Saxon.Hej.pull.PullSource.deliver(Receiver receiver, ParseOptions options)
at Saxon.Hej.event.Sender.send(Source source, Receiver receiver, ParseOptions options)
at Saxon.Eej.ee.s9api.SchemaValidatorImpl.validate(Source source)
at Saxon.Eej.Validate.processFile(Source source, SchemaValidator validator)
at Saxon.Eej.Validate.doValidate(String[] args)
Fatal error during validation: Object reference not set to an instance of an object.
I file that on category command line as the only schema related category "Schema conformance" doesn't seem adequate for the Saxon specific validation report. But the error seems to occur as well in C# code trying to use the SaxonCS API to generate a validation report.
Files
Please register to edit this issue
Actions