-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misleading error messages for incorrect versions #150
Comments
Hi @maria-messerschmidt at the moment version coverage is restricted to v1.3 officially although the code is ready to support further validation. The error reporting is simply a forwarding of the the message returned by the XML validation library. Might it be possible to get a few examples so I can take a look at this behaviour and put some improvements/fixes in place? |
Hi @carlwilson, I have included examples below. The issue relates to files which are not ODS 1.3. I would expect files that are version 1.0/1.1 or 1.2 to generate an relevant error message and report the version. This is not the case. While 1.0/1.1 fails validation, 1.2 passes validation with no errors. And the error generated for 1.0/1.1 does not give any information about the version. Valid file: ODS version 1.3 (T002.ods) Invalid file: ODS version 1.2 (T105.ods) Invalid file: ODS version 1.0/1.1 (T104.ods) I guess an issue is that versions (and extended versions as reported in #151 ) are not indicated in a simple way in the ODS files. For 1.2 and 1.3, version is indicated in the manifest, but this is not the case for 1.0/1.1. I hope the explanation and examples are useful. If you need anything else, pls let me know :) |
Version can vary across the different files, but the value for office:version in the header of content.xml seems to always be populated, even for version 1. Ideally, we would have a single error message for this and #151 saying something like (with the relevant selection based on validation of the file): "The file must be an ODF package v1.3. Version detected: There are generally no XML errors for v1.2, and as specified in #151 the XML-4 errors or extended packages should not be reported separately. There are two XML-4 errors for v1.0/1.1 which should also not be reported separately if there is a consolidated error message for incorrect version/format. XML-4: META-INF\manifest.xml [ERROR] Not a valid XML document. Validation exception at line 2 and column 88: element "manifest:manifest" missing required attribute "manifest:version". |
1.2 now works and generates a POL_2 error message indicating the version. 1.0/1.1 still has some issues and produces the following: C:\odf\odf-validator-main>odf-validator.bat -p "C:\Users\maria\Desktop\2024-07\AT033\AT033.ods" |
Solved for 1.2, but only partially for 1.0/1.1. Previously two XML-4 errors were reported. Now only the second of these (in content.xml) is reported. APP-1: [INFO] Validating D:\odsfiler\AT047.ods. |
According to Section 4.16.14.2 of the ODF Package Specification, the value of the manifest:version attribute shall be "1.3". This is not checked by the validator.
When validating an ODF package version 1.0/1.1, the following error is reported:
"XML-4: META-INF\manifest.xml [ERROR] Not a valid XML document. Validation exception at line 2 and column 88: element "manifest:manifest" missing required attribute "manifest:version"." (along with other XML-4 errors)
When validating an ODF package version 1.2, no error is reported, and the package validates without issues.
According to the OPF specification, the following check should be done:
DOC-2 (Info)
OpenDocument version detected.
Reports the OpenDocument version of the document.
This is only reported occassionally, and I am not sure what triggers it to be reported since it is absent from the log in most cases I have tested. It is only an INFO level message though, so not sure it would make a difference even if it did log the version correctly every time.
But the files should be compliant with version 1.3, and the error message should indicate that it is the version that is the problem.
The text was updated successfully, but these errors were encountered: