Package org.xmlunit.validation
Class ParsingValidator
java.lang.Object
org.xmlunit.validation.Validator
org.xmlunit.validation.ParsingValidator
Validator implementation that uses "the old way" of validating an
XML input by parsing the input.
Even though this implementation supports W3C Schema you shouldn't use it for that language but rather use JAXPValidator.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
private static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
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.Validates an instance against the schema.validateInstance
(Source s, SAXParserFactory factory) Validates an instance against the schema using a pre-configuredSAXParserFactory
.ParsingValidator
doesn't support validation of the schema itself.Methods inherited from class org.xmlunit.validation.Validator
forLanguage, getSchemaSources, setSchemaSource, setSchemaSources
-
Field Details
-
language
-
schemaURI
-
-
Constructor Details
-
ParsingValidator
-
-
Method Details
-
setSchemaURI
The URI (or for example the System ID in case of a DTD) that identifies the schema to validate or use during validation. -
getSchemaURI
The URI (or for example the System ID in case of a DTD) that identifies the schema validated or used during validation. -
validateSchema
ParsingValidator
doesn't support validation of the schema itself.- Specified by:
validateSchema
in classValidator
- Throws:
XMLUnitException
- always
-
validateInstance
Description copied from class:Validator
Validates an instance against the schema.- Specified by:
validateInstance
in classValidator
-
validateInstance
Validates an instance against the schema using a pre-configuredSAXParserFactory
.The factory given will be configured to be namespace aware and validating.
- Parameters:
s
- the instance documentfactory
- the factory to use, must not be null- Since:
- XMLUnit 2.6.0
-