public class ParsingValidator extends Validator
Even though this implementation supports W3C Schema you shouldn't use it for that language but rather use JAXPValidator.
| Constructor and Description |
|---|
ParsingValidator(String language)
Creates a validator for the given schema language.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
getSchemaURI()
The URI (or for example the System ID in case of a DTD) that
identifies the schema validated or used during validation.
|
void |
setSchemaURI(String uri)
The URI (or for example the System ID in case of a DTD) that
identifies the schema to validate or use during validation.
|
ValidationResult |
validateInstance(Source s)
Validates an instance against the schema.
|
ValidationResult |
validateInstance(Source s,
SAXParserFactory factory)
Validates an instance against the schema using a pre-configured
SAXParserFactory. |
ValidationResult |
validateSchema()
ParsingValidator doesn't support validation of the
schema itself. |
forLanguage, getSchemaSources, setSchemaSource, setSchemaSourcespublic ParsingValidator(String language)
language - the schema languagepublic void setSchemaURI(String uri)
uri - the schema URIprotected String getSchemaURI()
public ValidationResult validateSchema()
ParsingValidator doesn't support validation of the
schema itself.validateSchema in class ValidatorXMLUnitException - alwayspublic ValidationResult validateInstance(Source s)
ValidatorvalidateInstance in class Validators - the instance to validatepublic ValidationResult validateInstance(Source s, SAXParserFactory factory)
SAXParserFactory.
The factory given will be configured to be namespace aware and validating.
s - the instance documentfactory - the factory to use, must not be nullCopyright © 2001–2025 XMLUnit. All rights reserved.