Class PSXPathValidationHandlerSVRL
java.lang.Object
com.helger.schematron.pure.validation.xpath.PSXPathValidationHandlerSVRL
- All Implemented Interfaces:
IPSValidationHandler
@NotThreadSafe
public class PSXPathValidationHandlerSVRL
extends Object
implements IPSValidationHandler
A special validation handler that creates an SVRL document. This class only
works for the XPath binding, as the special
PSXPathBoundAssertReport
class is referenced!- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal IPSErrorHandlercom.helger.schematron.svrl.jaxb.SchematronOutputTypegetSVRL()com.helger.commons.state.EContinueonFailedAssert(PSAssertReport aAssertReport, String sTestExpression, Node aRuleMatchingNode, int nNodeIndex, Object aContext) This method is called for every failed assert.voidonFiredRule(PSRule aRule, String sContext, int nNodeIndex, int nNodeCount) This method is called for every rule inside the current pattern.voidThis method is called for every pattern inside the schema.voidThis is the first method called.com.helger.commons.state.EContinueonSuccessfulReport(PSAssertReport aAssertReport, String sTestExpression, Node aRuleMatchingNode, int nNodeIndex, Object aContext) This method is called for every failed assert.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.helger.schematron.pure.validation.IPSValidationHandler
and, onEnd, onRuleStart
-
Constructor Details
-
PSXPathValidationHandlerSVRL
Constructor- Parameters:
aErrorHandler- The error handler to be used. May not benull.
-
-
Method Details
-
getErrorHandler
-
onStart
public void onStart(@Nonnull PSSchema aSchema, @Nullable PSPhase aActivePhase, @Nullable String sBaseURI) throws SchematronValidationException Description copied from interface:IPSValidationHandlerThis is the first method called.- Specified by:
onStartin interfaceIPSValidationHandler- Parameters:
aSchema- The Schematron to be validated. Nevernull.aActivePhase- The selected phase, if any special phase was selected. May benull.sBaseURI- The Base URI of the XML to be validated. May benull.- Throws:
SchematronValidationException- In case of validation errors- See Also:
-
onPattern
Description copied from interface:IPSValidationHandlerThis method is called for every pattern inside the schema.- Specified by:
onPatternin interfaceIPSValidationHandler- Parameters:
aPattern- The current pattern. Nevernull.
-
onFiredRule
public void onFiredRule(@Nonnull PSRule aRule, @Nonnull String sContext, @Nonnull int nNodeIndex, @Nonnull int nNodeCount) Description copied from interface:IPSValidationHandlerThis method is called for every rule inside the current pattern. Was called "onRule" previously.- Specified by:
onFiredRulein interfaceIPSValidationHandler- Parameters:
aRule- The current rule. Nevernull.sContext- The real context to be used in validation. May differ from the result ofPSRule.getContext()because of replaced variables from <let> elements.nNodeIndex- 0-based node index currently firednNodeCount- The total number of nodes for this rule. Always > 0.
-
onFailedAssert
@Nonnull public com.helger.commons.state.EContinue onFailedAssert(@Nonnull PSAssertReport aAssertReport, @Nonnull String sTestExpression, @Nonnull Node aRuleMatchingNode, int nNodeIndex, @Nullable Object aContext) throws SchematronValidationException Description copied from interface:IPSValidationHandlerThis method is called for every failed assert.- Specified by:
onFailedAssertin interfaceIPSValidationHandler- Parameters:
aAssertReport- The current assert element. Nevernull.sTestExpression- The source XPath expression that was evaluated for this node. It may be different from the test expression contained in the passed assert/report element because of replaced <let> elements. Nevernull.aRuleMatchingNode- The XML node of the document to be validated.nNodeIndex- The index of the matched node, relative to the current rule.aContext- A context object - implementation dependent. For the default query binding this is e.g. anPSXPathBoundAssertReportobject.- Returns:
EContinue.BREAKto stop validating immediately.- Throws:
SchematronValidationException- In case of validation errors
-
onSuccessfulReport
@Nonnull public com.helger.commons.state.EContinue onSuccessfulReport(@Nonnull PSAssertReport aAssertReport, @Nonnull String sTestExpression, @Nonnull Node aRuleMatchingNode, int nNodeIndex, @Nullable Object aContext) throws SchematronValidationException Description copied from interface:IPSValidationHandlerThis method is called for every failed assert.- Specified by:
onSuccessfulReportin interfaceIPSValidationHandler- Parameters:
aAssertReport- The current assert element. Nevernull.sTestExpression- The source XPath expression that was evaluated for this node. It may be different from the test expression contained in the passed assert/report element because of replaced <let> elements. Nevernull.aRuleMatchingNode- The XML node of the document to be validated.nNodeIndex- The index of the matched node, relative to the current rule.aContext- A context object - implementation dependent. For the default query binding this is e.g. anPSXPathBoundAssertReportobject.- Returns:
EContinue.BREAKto stop validating immediately.- Throws:
SchematronValidationException- In case of validation errors
-
getSVRL
-