Class InvalidityReportGenerator

  • All Implemented Interfaces:
    Direct Known Subclasses:

    public class InvalidityReportGenerator
    extends StandardInvalidityHandler
    This class InvalidityReportGenerator extends the standard error handler for errors found during validation of an instance document against a schema, used if user specifies -report option on validate. Its effect is to output the validation errors found into the filename specified in an XML format.
    • Constructor Detail

      • InvalidityReportGenerator

        public InvalidityReportGenerator​(Configuration config)
      • InvalidityReportGenerator

        public InvalidityReportGenerator​(Configuration config,
                                         Outputter receiver)
                                  throws XPathException
        Create a Report Invalidity Handler writing to a Receiver
        config - the Saxon configuration
        receiver - required to output the validation errors
    • Method Detail

      • setReceiver

        public void setReceiver​(Outputter receiver)
        Set the receiver
        receiver - required to output the validation errors
      • setSystemId

        public void setSystemId​(java.lang.String id)
        Set the XML document that is to be validated
        id - of the source document
      • setSchemaName

        public void setSchemaName​(java.lang.String name)
        Set the XSD document used to validation process
        name - of xsd file
      • getErrorCount

        public int getErrorCount()
      • getWarningCount

        public int getWarningCount()
      • setXsdVersion

        public void setXsdVersion​(java.lang.String version)
      • endReporting

        public Sequence endReporting()
                              throws XPathException
        Description copied from class: StandardInvalidityHandler
        Get the value to be associated with a validation exception. May return null. In the case of the InvalidityReportGenerator, this returns the XML document containing the validation report
        Specified by:
        endReporting in interface InvalidityHandler
        endReporting in class StandardInvalidityHandler
        a value (or null). This will be the value returned as the value of the variable $err:value during try/catch processing
        XPathException - if an error occurs creating any validation report
      • createMetaData

        public void createMetaData()
                            throws XPathException
        Create metedata element which contains summary information in the output XML document
        XPathException - if creating the element fails for any reason