ODF Validator

ODF Validator

The purpose of this project is to provide a simple command-line validator, which developers and administrators can use to ensure the consistency and correctness of OpenDocument files.

This is part of the ODF Tools project.

Requirements

This requires the following commands to be available:

  • unzip - for accessing the contents of OpenDocuments;
  • xmllint - for performing validation and pretty-printing.

Usage

odf-validate [--strict] --file path/to/an/opendocument.odt

The validator will list out any problems it finds with the file. Errors are fatal: these are problems where the file does not conform to the OpenDocument specification. Warnings are less fatal, but could indicate problems.

Some of the errors will be somewhat inscrutable. You will probably not be able to fix them unless you're a developer.

Checks

This is a non-exhaustive list of the checks this tool performs:

  • right files being present in a package;
  • mimetype and file extension exist and correspond;
  • that all XML is valid XML;
  • manifest.xml exists and is correct according to the RelaxNG schema;
  • content.xml, meta.xml, settings.xml and styles.xml exist and are correct according to the RelaxNG schema;
  • that all defined XML namespaces that are used are correct according to the OpenDocument specification;
  • probably other things I forgot.

Warning

The most updated version is the Online Validator. There may be additional features or bugfixes that are present in the online validator but not in the download version.

Help Out

Please let us know of any extra tests you think we can perform, new checks, or about documents and/or applications you've found which trip up the validator, or trip up on the validator :)