Package com.saxonica.ee.validate
Class InSituValidator
java.lang.Object
com.saxonica.ee.validate.InSituValidator
This class performs in-situ validation of a tree represented in memory as a NodeInfo
object. The standard copy() method is used to copy the tree to a validation pipeline
as a sequence of events. The locationId on these events is used to maintain a mapping
back to the original nodes in the tree, so that the original tree can be updated with
type annotations and expanded defaults reflecting the decisions of the validator.
Note that if validation fails, the tree will not be in a usable state. For this reason it may be desirable to do the validation twice, once with a Sink as the destination, and only use the in-situ validation once it is known that it will succeed.
-
Constructor Summary
ConstructorsConstructorDescriptionInSituValidator
(MutableNodeInfo root, int validationMode) Create an InSituValidator -
Method Summary
-
Constructor Details
-
InSituValidator
Create an InSituValidator- Parameters:
root
- the root node of the tree to be validated. This must be a document or element node, and it must be an updatable nodevalidationMode
- the validation mode:Validation.STRICT
orValidation.LAX
-
-
Method Details
-
validate
Perform the validation- Throws:
XPathException
- if it is not possible to construct a validator, or if validation fails.
-