diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/package-30.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/package-30.rnc index 4102182d9..8d5ba0873 100644 --- a/src/main/resources/com/adobe/epubcheck/schema/30/package-30.rnc +++ b/src/main/resources/com/adobe/epubcheck/schema/30/package-30.rnc @@ -128,5 +128,5 @@ opf.href.attr = attribute href { datatype.URI } opf.id.attr = attribute id { datatype.ID } opf.i18n.attrs = opf.xml.lang.attr? & opf.dir.attr? - opf.xml.lang.attr = attribute xml:lang { datatype.languagecode } + opf.xml.lang.attr = attribute xml:lang { "" | datatype.languagecode } opf.dir.attr = attribute dir { 'ltr' | 'rtl' } diff --git a/src/test/resources/epub3/files/package-document/lang-empty-valid.opf b/src/test/resources/epub3/files/package-document/lang-empty-valid.opf new file mode 100644 index 000000000..21de466a7 --- /dev/null +++ b/src/test/resources/epub3/files/package-document/lang-empty-valid.opf @@ -0,0 +1,17 @@ + + + + Title + en + NOID + 2019-01-01T12:00:00Z + Jane Doe + + + + + + + + diff --git a/src/test/resources/epub3/package-document.feature b/src/test/resources/epub3/package-document.feature index a7528e07d..d599a04f5 100644 --- a/src/test/resources/epub3/package-document.feature +++ b/src/test/resources/epub3/package-document.feature @@ -30,8 +30,8 @@ Feature: EPUB 3 ▸ Packages ▸ Package Document Checks Then fatal error RSC-016 is reported (parsing error) And error RSC-005 is reported (schema error) And no other errors or warnings are reported - - + + # 3.4 Pacakge Document Definition ## 3.4.1 The package element @@ -86,6 +86,10 @@ Feature: EPUB 3 ▸ Packages ▸ Package Document Checks When checking file 'id-duplicate-with-spaces-error.opf' Then error RSC-005 is reported 2 times (once for each ID) And no other errors or warnings are reported + + Scenario: the `xml:lang` attribute can be empty + When checking file 'lang-empty-valid.opf' + Then no other errors or warnings are reported ## 3.4.3 Metadata ### 3.4.3 The metadata element