The CLI output of the ODF validator in JSON or XML form does not seem to be valid JSON or XML.
-
Both output lines like this before and after the (valid) JSON or XML output, thereby making the output invalid JSON or XML:
APP-1: [INFO] Validating ..\testcorpora\odf files\test document.odt.
APP-4: [INFO] Validation report for ..\testcorpora\odf files\test document.odt.
VALID, no errors, 1 warnings found and 2 info messages.
-
In the XML output, there are multiple validation_report root elements. If there are multiple, I would have expected e.g. a root validation_reports container.
-
In the XML output, validation_results has a validation_results sub-tag which is not incorrect but awkward. Rename the inner one to validation_result? See also checks (rename to check?) in checks and parameters (rename to parameter?) in parameters.
Example Windows CLI output (XXXXXXXXXX>java -jar tools\odf-validator\odf-validator-0.20-beta-1-all.jar "..\testcorpora\odf files"* -e -o XML)
APP-1: [INFO] Validating ..\testcorpora\odf files\test document.odt.
APP-4: [INFO] Validation report for ..\testcorpora\odf files\test document.odt.
<validation_report>
<filename>..\testcorpora\odf files\test document.odt</filename>
<validation_results>
<validation_results>
<name>ODF Specification Validation</name>
<valid>true</valid>
<checks>
<checks>
<message>
<id>DOC-2</id>
<severity>INFO</severity>
<title>OpenDocument version 1.4 detected.</title>
<parameters>
<parameters>
<name>version</name>
<value>1.4</value>
</parameters>
</parameters>
<timestamp>2026-03-21 11:22 UTC</timestamp>
<text></text>
</message>
<path>package</path>
</checks>
<checks>
<message>
<id>DOC-3</id>
<severity>INFO</severity>
<title>OpenDocument MIMETYPE application/vnd.oasis.opendocument.text detected</title>
<parameters>
<parameters>
<name>mimetype</name>
<value>application/vnd.oasis.opendocument.text</value>
</parameters>
</parameters>
<timestamp>2026-03-21 11:22 UTC</timestamp>
<text></text>
</message>
<path>mimetype</path>
</checks>
<checks>
<message>
<id>PKG-7</id>
<severity>WARNING</severity>
<title>An OpenDocument Package SHOULD contain a preview image Thumbnails/thumbnail.png.</title>
<parameters/>
<timestamp>2026-03-21 11:22 UTC</timestamp>
<text></text>
</message>
<path>Thumbnails/thumbnail.png</path>
</checks>
</checks>
</validation_results>
</validation_results>
<is_valid>true</is_valid>
<format>application/vnd.oasis.opendocument.text</format>
<is_encrypted>false</is_encrypted>
<version>1.4</version>
</validation_report>
VALID, no errors, 1 warnings found and 2 info messages.
APP-1: [INFO] Validating ..\testcorpora\odf files\test_spreadsheet.ods.
APP-4: [INFO] Validation report for ..\testcorpora\odf files\test_spreadsheet.ods.
<validation_report>
<filename>..\testcorpora\odf files\test_spreadsheet.ods</filename>
<validation_results>
<validation_results>
<name>ODF Specification Validation</name>
<valid>true</valid>
<checks>
<checks>
<message>
<id>DOC-2</id>
<severity>INFO</severity>
<title>OpenDocument version 1.4 detected.</title>
<parameters>
<parameters>
<name>version</name>
<value>1.4</value>
</parameters>
</parameters>
<timestamp>2026-03-21 11:22 UTC</timestamp>
<text></text>
</message>
<path>package</path>
</checks>
<checks>
<message>
<id>DOC-3</id>
<severity>INFO</severity>
<title>OpenDocument MIMETYPE application/vnd.oasis.opendocument.spreadsheet detected</title>
<parameters>
<parameters>
<name>mimetype</name>
<value>application/vnd.oasis.opendocument.spreadsheet</value>
</parameters>
</parameters>
<timestamp>2026-03-21 11:22 UTC</timestamp>
<text></text>
</message>
<path>mimetype</path>
</checks>
<checks>
<message>
<id>PKG-7</id>
<severity>WARNING</severity>
<title>An OpenDocument Package SHOULD contain a preview image Thumbnails/thumbnail.png.</title>
<parameters/>
<timestamp>2026-03-21 11:22 UTC</timestamp>
<text></text>
</message>
<path>Thumbnails/thumbnail.png</path>
</checks>
</checks>
</validation_results>
</validation_results>
<is_valid>true</is_valid>
<format>application/vnd.oasis.opendocument.spreadsheet</format>
<is_encrypted>false</is_encrypted>
<version>1.4</version>
</validation_report>
VALID, no errors, 1 warnings found and 2 info messages.
APP-1: [INFO] Validating ..\testcorpora\odf files\test_spreadsheet.xlsx.
APP-4: [INFO] Validation report for ..\testcorpora\odf files\test_spreadsheet.xlsx.
<validation_report>
<filename>..\testcorpora\odf files\test_spreadsheet.xlsx</filename>
<validation_results>
<validation_results>
<name>ODF Specification Validation</name>
<valid>false</valid>
<checks>
<checks>
<message>
<id>DOC-2</id>
<severity>INFO</severity>
<title>OpenDocument version unknown detected.</title>
<parameters>
<parameters>
<name>version</name>
<value>unknown</value>
</parameters>
</parameters>
<timestamp>2026-03-21 11:22 UTC</timestamp>
<text></text>
</message>
<path>package</path>
</checks>
<checks>
<message>
<id>PKG-4</id>
<severity>WARNING</severity>
<title>An OpenDocument Package SHOULD contain a file 'mimetype'.</title>
<parameters/>
<timestamp>2026-03-21 11:22 UTC</timestamp>
<text></text>
</message>
<path>mimetype</path>
</checks>
<checks>
<message>
<id>PKG-3</id>
<severity>ERROR</severity>
<title>An OpenDocument Package SHALL contain a file 'META-INF/manifest.xml'.</title>
<parameters/>
<timestamp>2026-03-21 11:22 UTC</timestamp>
<text></text>
</message>
<path>META-INF/manifest.xml</path>
</checks>
<checks>
<message>
<id>PKG-7</id>
<severity>WARNING</severity>
<title>An OpenDocument Package SHOULD contain a preview image Thumbnails/thumbnail.png.</title>
<parameters/>
<timestamp>2026-03-21 11:22 UTC</timestamp>
<text></text>
</message>
<path>Thumbnails/thumbnail.png</path>
</checks>
</checks>
</validation_results>
</validation_results>
<is_valid>false</is_valid>
<format>application/zip</format>
<is_encrypted>false</is_encrypted>
<version>unknown</version>
</validation_report>
NOT VALID, 1 errors, 2 warnings and 1 info messages.
The CLI output of the ODF validator in JSON or XML form does not seem to be valid JSON or XML.
Both output lines like this before and after the (valid) JSON or XML output, thereby making the output invalid JSON or XML:
APP-1: [INFO] Validating ..\testcorpora\odf files\test document.odt.
APP-4: [INFO] Validation report for ..\testcorpora\odf files\test document.odt.
VALID, no errors, 1 warnings found and 2 info messages.
In the XML output, there are multiple validation_report root elements. If there are multiple, I would have expected e.g. a root validation_reports container.
In the XML output, validation_results has a validation_results sub-tag which is not incorrect but awkward. Rename the inner one to validation_result? See also checks (rename to check?) in checks and parameters (rename to parameter?) in parameters.
Example Windows CLI output (XXXXXXXXXX>java -jar tools\odf-validator\odf-validator-0.20-beta-1-all.jar "..\testcorpora\odf files"* -e -o XML)