Class XmlXsdValidator

java.lang.Object
com.aquima.interactions.foundation.xml.validation.XmlXsdValidator
All Implemented Interfaces:
IXmlValidator

public class XmlXsdValidator extends Object implements IXmlValidator
This class can be used to validate an XML using XSD schema definition(s).
Since:
6.4
Author:
Jon van Leuven
  • Constructor Details

    • XmlXsdValidator

      public XmlXsdValidator(IResource xsdSchema)
      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

      public XmlXsdValidator(IResource[] xsdSchemas)
      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

      public void validate(IResource xml)
      Description copied from interface: IXmlValidator
      Validate an XML resource.
      Specified by:
      validate in interface IXmlValidator
      Parameters:
      xml - The xml resource.
    • validate

      public void validate(String doc)
      Description copied from interface: IXmlValidator
      Validate an XML string.
      Specified by:
      validate in interface IXmlValidator
      Parameters:
      doc - The xml string.