Package com.helger.schematron.pure.bound
Interface IPSBoundSchema
- All Known Implementing Classes:
AbstractPSBoundSchema,PSXPathBoundSchema
public interface IPSBoundSchema
Base interface for a bound schema. A bound schema is a
PSSchema with
a specific- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptioncom.helger.commons.collection.impl.ICommonsList<PSPattern>com.helger.xml.namespace.MapBasedNamespaceContextgetPhase()getValidationContext(String sRuleContext) Get the validation context to be used.booleanvoidvalidate(Node aNode, String sBaseURI, IPSValidationHandler aHandler) The generic validation method.com.helger.schematron.svrl.jaxb.SchematronOutputTypevalidateComplete(Node aNode, String sBaseURI) Special validation that creates an SVRL document.com.helger.commons.state.EValidityvalidatePartially(Node aNode, String sBaseURI) Special validation that breaks on the first error.
-
Method Details
-
getQueryBinding
- Returns:
- The query binding that was used to create this bound schema.
-
getOriginalSchema
- Returns:
- The original schema used to bind. Never
null.
-
getNamespaceContext
- Returns:
- The namespace context as defined by the namespaces in the original
schema. Never
null.
-
getPhaseID
- Returns:
- Get the phase ID used. If none was specified, the schema
defaultPhase is used. If this is not present, than all patterns are
used and ID of the phase is
CSchematron.PHASE_ALL.
-
getPhase
- Returns:
- The phase object to be evaluated. May be
nullif no specific phase is to be validated!
-
isPhaseSpecified
boolean isPhaseSpecified()- Returns:
trueif a special phase was specified,falseif not.
-
getAllRelevantPatterns
@Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsList<PSPattern> getAllRelevantPatterns()- Returns:
- A list of all patterns to be validated. If a phase was selected,
only the patterns matching the selected phase are contained. Never
null.
-
getValidationContext
Get the validation context to be used. As rules can be stated as "element" they are not necessarily present on root level. For XPath this may e.g. be resolved by prepending "//" so that all elements are resolved correctly.- Parameters:
sRuleContext- The original rule context. May not benull.- Returns:
- The real validation context to use.
-
validate
void validate(@Nonnull Node aNode, @Nullable String sBaseURI, @Nonnull IPSValidationHandler aHandler) throws SchematronValidationException The generic validation method. It validates the passed XML node to this bound schema.- Parameters:
aNode- The node to be validated. May not benull.sBaseURI- Base URI of the XML to be validated. May benull.aHandler- The validation handler that receives the callback informations. May not benull.- Throws:
SchematronValidationException- In case a validation exception occurs
-
validatePartially
@Nonnull com.helger.commons.state.EValidity validatePartially(@Nonnull Node aNode, @Nullable String sBaseURI) throws SchematronValidationException Special validation that breaks on the first error. This is a specialized call ofvalidate(Node, String, IPSValidationHandler).- Parameters:
aNode- The XML node to be validated. May not benull.sBaseURI- Base URI of the XML to be validated. May benull.- Returns:
EValidity.VALIDif the document is valid,EValidity.INVALIDif it is invalid.- Throws:
SchematronValidationException- In case a validation exception occurs
-
validateComplete
@Nonnull com.helger.schematron.svrl.jaxb.SchematronOutputType validateComplete(@Nonnull Node aNode, @Nullable String sBaseURI) throws SchematronValidationException Special validation that creates an SVRL document. This is a specialized call ofvalidate(Node, String, IPSValidationHandler).- Parameters:
aNode- The XML node to be validated. May not benull.sBaseURI- Base URI of the XML to be validated. May benull.- Returns:
- The SVRL domain object.
- Throws:
SchematronValidationException- In case a validation exception occurs
-