edu.northwestern.at.morphadorner.tools.validatexmlfiles

## Class ValidateXMLFiles

- java.lang.Object
- - edu.northwestern.at.morphadorner.tools.validatexmlfiles.ValidateXMLFiles

-     public class ValidateXMLFiles
      extends java.lang.Object

  Validate XML files.

  Usage:

  >       java edu.northwestern.at.morphadorner.tools.validatexmlfiles.ValidateXMLFiles [schemaURI] input1.xml input2.xml ...

  schemaURI | Optional URI for a Relax NG or W3C schema against which to validate subsequent files. The schemaURi is treated as a Relax NG schema if it ends in ".rng", and as a W3C schema if it ends in ".xsd". The schema is ignored if it ends in anything else.
  input*.xml | input XML files to validate. At least one file must be specified.

  Checks that the specified XML files are valid XML. For XML files referencing a DTD, checks that the XML is valid in the context of the DTD. For XML files that do not specify a DTD, the XML is validated against the optional leading Relax NG or W3C schema. If a schema file is not specified, and the XML document does not specify a DTD, the file will generally be reported as invalid.

  Note: Creates a SAX parser for each document (one at a time). This allows even large adorned files to be validated.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static ValidationErrorHandler` | `errorHandler` Validation error handler.
    `protected static javax.xml.validation.Schema` | `schema` Holds compiled schema.
    `protected static javax.xml.validation.Validator` | `validator` Schema validator.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ValidateXMLFiles()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static boolean` | `initialize(java.lang.String[] args)` Initialize.
    `static void` | `main(java.lang.String[] args)` Main program.
    `protected static int` | `processFiles(java.lang.String[] args)` Process files.
    `protected static void` | `processOneFile(java.lang.String xmlFileName)` Process one file.
    `protected static void` | `terminate(int filesProcessed, long processingTime)` Terminate.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### schema

          protected static javax.xml.validation.Schema schema

      Holds compiled schema. May be null if no schema provided.

    - #### validator

          protected static javax.xml.validation.Validator validator

      Schema validator. May be null if no schema provided.

    - #### errorHandler

          protected static ValidationErrorHandler errorHandler

      Validation error handler.

  - ### Constructor Detail

    - #### ValidateXMLFiles

          public ValidateXMLFiles()

  - ### Method Detail

    - #### main

          public static void main(java.lang.String[] args)

      Main program.
      Parameters:
        `args` - Program parameters.

    - #### initialize

          protected static boolean initialize(java.lang.String[] args)

      Initialize.

    - #### processOneFile

          protected static void processOneFile(java.lang.String xmlFileName)

      Process one file.
      Parameters:
        `xmlFileName` - Input file name to check for Latin words.

    - #### processFiles

          protected static int processFiles(java.lang.String[] args)

      Process files.

    - #### terminate

          protected static void terminate(int filesProcessed,
                       long processingTime)

      Terminate.
      Parameters:
        `filesProcessed` - Number of files processed.
        `processingTime` - Processing time in seconds.