public class SchematronValidator extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ISO_SCHEMATRON_SVRL_NS |
| Constructor and Description |
|---|
SchematronValidator(Source schema,
String phase)
Construct a validator for the given Schematron schema and phase (pattern
set).
|
| Modifier and Type | Method and Description |
|---|---|
(package private) net.sf.saxon.s9api.XsltExecutable |
compileSchema(Source schema,
String phase)
Creates an immutable representation of a compiled stylesheet that will
generate an SVRL representation of the validation results when run
against an instance document.
|
int |
getRuleViolationCount()
Get the number of violations (failed assertions and successful reports)
for the validation episode.
|
boolean |
ruleViolationsDetected()
Indicates the occurrence of any rule violations.
|
void |
setParameters(Map<String,String> params)
Sets parameters required to evaluate Schematron rules.
|
DOMResult |
validate(Source xmlSource)
Validates the specified source XML document and returns the results in an
SVRL report.
|
ValidationErrorHandler |
validateSchema(Source schema)
Validates a Schematron schema against the official RELAX NG grammar (ISO
19757-3, Annex A).
|
public static final String ISO_SCHEMATRON_SVRL_NS
public SchematronValidator(Source schema, String phase) throws Exception
schema - The ISO Schematron schema to use for validation.phase - The active phase (rule subset). If null the default
phase is used.Exception - If any error occurs while attempting to read or preprocess
the schema.public ValidationErrorHandler validateSchema(Source schema) throws IOException
schema - A Source to obtain the schema from.IOException - If an error occurs while reading the schema.public int getRuleViolationCount()
int value equal to or greater than zero.public boolean ruleViolationsDetected()
true if any rule violations have been detected;
false otherwise.public void setParameters(Map<String,String> params)
params - A Map<String,String> object containing parameter
names and values.public DOMResult validate(Source xmlSource)
xmlSource - The XML resource to validate.final net.sf.saxon.s9api.XsltExecutable compileSchema(Source schema, String phase) throws Exception
schema - A Source to read a Schematron schema.phase - The phase (patterns sets) to check.Exception - If the schema cannot be compiled for any reason.Copyright © 2015 Open Geospatial Consortium. All rights reserved.