use of org.oclc.purl.dsdl.svrl.SuccessfulReport in project ph-schematron by phax.
the class PSXPathValidationHandlerSVRL method onSuccessfulReport.
@Override
@Nonnull
public EContinue onSuccessfulReport(@Nonnull final PSAssertReport aAssertReport, @Nonnull final String sTestExpression, @Nonnull final Node aRuleMatchingNode, final int nNodeIndex, @Nullable final Object aContext) throws SchematronValidationException {
if (!(aContext instanceof PSXPathBoundAssertReport))
throw new SchematronValidationException("The passed context must be an XPath object but is a " + aContext);
final PSXPathBoundAssertReport aBoundAssertReport = (PSXPathBoundAssertReport) aContext;
final SuccessfulReport aSuccessfulReport = new SuccessfulReport();
aSuccessfulReport.setFlag(aAssertReport.getFlag());
aSuccessfulReport.setId(aAssertReport.getID());
aSuccessfulReport.setLocation(_getPathToNode(aRuleMatchingNode));
// TODO role
aSuccessfulReport.setTest(sTestExpression);
aSuccessfulReport.setText(_getErrorText(aBoundAssertReport.getAllBoundContentElements(), aRuleMatchingNode));
_handleDiagnosticReferences(aAssertReport.getAllDiagnostics(), aSuccessfulReport.getDiagnosticReference(), aBoundAssertReport, aRuleMatchingNode);
m_aSchematronOutput.getActivePatternAndFiredRuleAndFailedAssert().add(aSuccessfulReport);
return EContinue.CONTINUE;
}
Aggregations