Class ParsingValidator


  • public class ParsingValidator
    extends Validator
    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.

    • Field Detail

      • language

        private final java.lang.String language
      • schemaURI

        private java.lang.String schemaURI
    • Constructor Detail

      • ParsingValidator

        public ParsingValidator​(java.lang.String language)
    • Method Detail

      • setSchemaURI

        public void setSchemaURI​(java.lang.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.
      • getSchemaURI

        protected java.lang.String getSchemaURI()
        The URI (or for example the System ID in case of a DTD) that identifies the schema validated or used during validation.
      • validateInstance

        public ValidationResult validateInstance​(javax.xml.transform.Source s,
                                                 javax.xml.parsers.SAXParserFactory factory)
        Validates an instance against the schema using a pre-configured SAXParserFactory.

        The factory given will be configured to be namespace aware and validating.

        Parameters:
        s - the instance document
        factory - the factory to use, must not be null
        Since:
        XMLUnit 2.6.0