From 6a3d2a6769a8d68009496ecbcdb3f8de4e8adcd8 Mon Sep 17 00:00:00 2001 From: Romain Deltour Date: Fri, 23 Dec 2022 19:06:00 +0100 Subject: [PATCH] feat: "xmp" is no longer a valid package link property The following entries were removed from the metadata link vocabulary in EPUB 3.3, due to low usage report: - the "acquire" relationship - the "xmp" property This commit removes the "xmp" from the link property vocabulary, so any use of it will be reported as an error. It keeps the "acquire" property in the relationship vocabulary, for backward compatibility notably with the EPUB Previews specification were it is defined. Close #1457 --- .../adobe/epubcheck/vocab/PackageVocabs.java | 4 +-- .../messages/MessageBundle.properties | 2 +- .../file-url-in-package-document-error.opf | 33 ++++++++++--------- .../link-rel-record-properties-valid.opf | 1 - .../D-vocabularies/metadata-link.feature | 17 +++++++--- 5 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/adobe/epubcheck/vocab/PackageVocabs.java b/src/main/java/com/adobe/epubcheck/vocab/PackageVocabs.java index 469124736..a1d0e6d6c 100644 --- a/src/main/java/com/adobe/epubcheck/vocab/PackageVocabs.java +++ b/src/main/java/com/adobe/epubcheck/vocab/PackageVocabs.java @@ -82,7 +82,8 @@ public static enum ITEMREF_PROPERTIES public static enum LINKREL_PROPERTIES implements PropertyStatus { - ACQUIRE, + ACQUIRE, // note: no longer defined in EPUB 3.3, but still accepted for + // backward compatibility with the EPUB Previews specification ALTERNATE, MARC21XML_RECORD(DEPRECATED), MODS_RECORD(DEPRECATED), @@ -123,7 +124,6 @@ public boolean isDeprecated() public static enum LINK_PROPERTIES { ONIX, - XMP; } private PackageVocabs() diff --git a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties index f942fdac3..973446a74 100644 --- a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties +++ b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties @@ -190,7 +190,7 @@ OPF_086_SUG.marc21xml-record=the "record" keyword and the media-type "applicatio OPF_086_SUG.mods-record=the "record" keyword and the media-type "application/mods+xml" OPF_086_SUG.onix-record=the "record" keyword with the properties attribute value "onix" OPF_086_SUG.xml-signature=no signature-identifying link -OPF_086_SUG.xmp-record=the "record" keyword with the properties attribute value "xmp" +OPF_086_SUG.xmp-record=the "record" keyword OPF_086b=epub:type value "%1$s" is deprecated. Consider using %2$s instead. OPF_086b_SUG.default=a custom prefixed value OPF_086b_SUG.annoref=open annotations diff --git a/src/test/resources/epub3/03-resources/files/file-url-in-package-document-error.opf b/src/test/resources/epub3/03-resources/files/file-url-in-package-document-error.opf index ff5cb8f92..77949ea42 100644 --- a/src/test/resources/epub3/03-resources/files/file-url-in-package-document-error.opf +++ b/src/test/resources/epub3/03-resources/files/file-url-in-package-document-error.opf @@ -1,17 +1,18 @@ - - - Minimal EPUB 3.0 - en - NOID - 2017-06-14T00:00:01Z - - - - - - - - - - \ No newline at end of file + + + Minimal EPUB 3.0 + en + NOID + 2017-06-14T00:00:01Z + + + + + + + + + + diff --git a/src/test/resources/epub3/D-vocabularies/files/link-rel-record-properties-valid.opf b/src/test/resources/epub3/D-vocabularies/files/link-rel-record-properties-valid.opf index 4c5875ade..2568dcb2f 100644 --- a/src/test/resources/epub3/D-vocabularies/files/link-rel-record-properties-valid.opf +++ b/src/test/resources/epub3/D-vocabularies/files/link-rel-record-properties-valid.opf @@ -7,7 +7,6 @@ NOID 2019-01-01T12:00:00Z - diff --git a/src/test/resources/epub3/D-vocabularies/metadata-link.feature b/src/test/resources/epub3/D-vocabularies/metadata-link.feature index 5ebd025ce..8329184bc 100644 --- a/src/test/resources/epub3/D-vocabularies/metadata-link.feature +++ b/src/test/resources/epub3/D-vocabularies/metadata-link.feature @@ -15,8 +15,11 @@ Feature: EPUB 3 — Vocabularies — Metadata link vocabulary #### D.4.1.1 acquire - @spec @xref:sec-acquire Scenario: an 'acquire' link can identify the full version of the publication + Note: + the 'acquire' relationship was removed in EPUB 3.3: + see https://github.com/w3c/epub-specs/issues/2489 + it is still accepted, for backward compatibility. When checking file 'link-rel-acquire-valid.opf' Then no errors or warnings are reported @@ -69,10 +72,6 @@ Feature: EPUB 3 — Vocabularies — Metadata link vocabulary Then error OPF-094 is reported And no other errors or warnings are reported - Scenario: a 'record' link type can be further identified with a 'properties' attribute - When checking file 'link-rel-record-properties-valid.opf' - And no errors or warnings are reported - @spec @xref:sec-record Scenario: a 'record' link cannot refine another property or resource When checking file 'link-rel-record-refines-error.opf' @@ -117,3 +116,11 @@ Feature: EPUB 3 — Vocabularies — Metadata link vocabulary And error OPF-093 is reported # note: 'media-type' is now required, even on deprecated properties And no other errors or warnings are reported + + + ### D.4.2 Link properties + + @spec @xref:sec-link-properties + Scenario: a 'record' link type can be further identified with a 'properties' attribute + When checking file 'link-rel-record-properties-valid.opf' + And no errors or warnings are reported