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 8d5ba0873..e3fbdb27a 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 @@ -26,10 +26,11 @@ opf.epub3.meta.content = (opf.property.attr & opf.refines.attr? & opf.id.attr? & opf.scheme.attr? & opf.i18n.attrs & datatype.string.nonempty) opf.epub2.meta.content = (attribute name { text } & attribute content { text }) #legacy - opf.link = element link { opf.href.attr & opf.rel.attr & opf.id.attr? & opf.refines.attr? & opf.media-type.attr? & opf.properties.attr? } + opf.link = element link { opf.href.attr & opf.hreflang.attr? & opf.rel.attr & opf.id.attr? & opf.refines.attr? & opf.media-type.attr? & opf.properties.attr? } opf.property.attr = attribute property { datatype.property } opf.rel.attr = attribute rel { datatype.properties } + opf.hreflang.attr = attribute hreflang { "" | datatype.string.nonempty } opf.scheme.attr = attribute scheme { datatype.property } opf.refines.attr = attribute refines { datatype.URI } diff --git a/src/test/resources/epub3/files/package-document/link-hreflang-empty-valid.opf b/src/test/resources/epub3/files/package-document/link-hreflang-empty-valid.opf new file mode 100644 index 000000000..57b80e736 --- /dev/null +++ b/src/test/resources/epub3/files/package-document/link-hreflang-empty-valid.opf @@ -0,0 +1,17 @@ + + + + Title + en + NOID + 2019-01-01T12:00:00Z + + + + + + + + + diff --git a/src/test/resources/epub3/files/package-document/link-hreflang-valid.opf b/src/test/resources/epub3/files/package-document/link-hreflang-valid.opf new file mode 100644 index 000000000..298175a5a --- /dev/null +++ b/src/test/resources/epub3/files/package-document/link-hreflang-valid.opf @@ -0,0 +1,17 @@ + + + + Title + en + NOID + 2019-01-01T12:00:00Z + + + + + + + + + diff --git a/src/test/resources/epub3/package-document.feature b/src/test/resources/epub3/package-document.feature index 5467d2fe0..cefa142c5 100644 --- a/src/test/resources/epub3/package-document.feature +++ b/src/test/resources/epub3/package-document.feature @@ -237,6 +237,14 @@ Feature: EPUB 3 ▸ Packages ▸ Package Document Checks When checking file 'link-to-publication-resource-error.opf' Then error OPF-067 is reported And no other errors or warnings are reported + + Scenario: the 'link' element can have an 'hreflang' attribute + When checking file 'link-hreflang-valid.opf' + Then no other errors or warnings are reported + + Scenario: the 'link' 'hreflang' attribute can be empty + When checking file 'link-hreflang-empty-valid.opf' + Then no other errors or warnings are reported ### 3.4.4 Manifest