Class XmlXsdValidator
java.lang.Object
com.aquima.interactions.foundation.xml.validation.XmlXsdValidator
- All Implemented Interfaces:
IXmlValidator
This class can be used to validate an XML using XSD schema definition(s).
- Since:
- 6.4
- Author:
- Jon van Leuven
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
Internal org.xml.sax.ErrorHandler implementation used for xsd validation. -
Constructor Summary
ConstructorsConstructorDescriptionXmlXsdValidator
(IResource xsdSchema) This constructor creates a validator using one xsd schema.XmlXsdValidator
(IResource[] xsdSchemas) This constructor creates a validator using multiple xsd schemas. -
Method Summary
-
Constructor Details
-
XmlXsdValidator
This constructor creates a validator using one xsd schema.- Parameters:
xsdSchema
- The xsd schema to validate with.- Throws:
XmlParseException
- Is thrown when the xsd schema is no valid xml.ResourceException
- Is thrown when the xsd schema could not be read.
-
XmlXsdValidator
This constructor creates a validator using multiple xsd schemas.- Parameters:
xsdSchemas
- The xsd schemas to validate with.- Throws:
XmlParseException
- Is thrown when one (or more) of the xsd schemas is no valid xml.ResourceException
- Is thrown when one (or more) of the xsd schemas could not be read.
-
-
Method Details
-
validate
Description copied from interface:IXmlValidator
Validate an XML resource.- Specified by:
validate
in interfaceIXmlValidator
- Parameters:
xml
- The xml resource.- Throws:
XmlValidationException
- Is thrown when the provided xml does not validate.
-
validate
Description copied from interface:IXmlValidator
Validate an XML string.- Specified by:
validate
in interfaceIXmlValidator
- Parameters:
doc
- The xml string.- Throws:
XmlValidationException
- Is thrown when the provided xml does not validate.
-