False error: xml:lang incorrectly required on <package> in EPUB 2 OPF
- Dominant language
- JavaScript
- Stars
- 23
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
ACE reports an error when an EPUB 2 OPF `` element does not contain an `xml:lang` attribute.
According to the EPUB 2.0.1 specification, the primary language of the publication must be declared with `` in the metadata section. The `xml:lang` attribute on `` is not part of the EPUB 2 schema and is therefore not permitted. Nevertheless, ACE currently reports its absence as an error.
This produces a false error message: a valid EPUB 2 package is incorrectly flagged as invalid. Moreover, if `xml:lang` is added to `` to satisfy ACE, the file becomes invalid under EPUB 2 and is rejected by EPUBCheck.
The underlying cause appears to be that `xml:lang` on `` is a requirement introduced in EPUB 3, but it is explicitly disallowed in EPUB 2. ACE therefore seems to apply an EPUB 3 validation rule to EPUB 2 content, resulting in contradictory validation outcomes between ACE and EPUBCheck.
Expected behavior:
ACE should not require `xml:lang` on `` when validating EPUB 2 files. The language declaration via `` should be treated as sufficient and compliant with EPUB 2.
Environment:
ACE version: 1.3.6
Platform: Windows
Validation mode: GUI
Contributor guide
Assessment
This issue has not been assessed yet.