public class JAXPValidator extends Validator
An implementation detail of javax.xml.validation.Validator
leaks into this class: any xsi:schemaLocation
or xsi:noSchemaLocation
attribute of
the instance document will be ignored if any schema source has been
set. This means you must either specify all sources or none of
them to successfully validate instances.
Constructor and Description |
---|
JAXPValidator(String language) |
JAXPValidator(String language,
SchemaFactory factory) |
Modifier and Type | Method and Description |
---|---|
void |
setSchema(Schema s)
Sets the schema to use in instance validation directly rather
than via
Validator.setSchemaSource(javax.xml.transform.Source) . |
ValidationResult |
validateInstance(Source s)
Validates an instance against the schema.
|
ValidationResult |
validateSchema()
Validates a schema.
|
forLanguage, getSchemaSources, setSchemaSource, setSchemaSources
public JAXPValidator(String language)
public JAXPValidator(String language, SchemaFactory factory)
public final void setSchema(Schema s)
Validator.setSchemaSource(javax.xml.transform.Source)
.public ValidationResult validateSchema()
Validator
validateSchema
in class Validator
public ValidationResult validateInstance(Source s)
Validator
validateInstance
in class Validator
Copyright © 2001–2017 XMLUnit. All rights reserved.