Skip to content

Commit

Permalink
feat: "xmp" is no longer a valid package link property
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rdeltour committed Jan 3, 2023
1 parent 2c76420 commit 6a3d2a6
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/adobe/epubcheck/vocab/PackageVocabs.java
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -123,7 +124,6 @@ public boolean isDeprecated()
public static enum LINK_PROPERTIES
{
ONIX,
XMP;
}

private PackageVocabs()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" xml:lang="en" unique-identifier="q">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title id="title">Minimal EPUB 3.0</dc:title>
<dc:language>en</dc:language>
<dc:identifier id="q">NOID</dc:identifier>
<meta property="dcterms:modified">2017-06-14T00:00:01Z</meta>
<link href="file:example" rel="acquire" media-type="text/html"/>
</metadata>
<manifest>
<item id="content_001" href="content_001.xhtml" media-type="application/xhtml+xml"/>
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>
</manifest>
<spine>
<itemref idref="content_001" />
</spine>
</package>
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" xml:lang="en" unique-identifier="q"
prefix="test: https://example.org">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title id="title">Minimal EPUB 3.0</dc:title>
<dc:language>en</dc:language>
<dc:identifier id="q">NOID</dc:identifier>
<meta property="dcterms:modified">2017-06-14T00:00:01Z</meta>
<link href="file:example" rel="test:rel" media-type="text/html"/>
</metadata>
<manifest>
<item id="content_001" href="content_001.xhtml" media-type="application/xhtml+xml"/>
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>
</manifest>
<spine>
<itemref idref="content_001"/>
</spine>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<dc:identifier id="uid">NOID</dc:identifier>
<meta property="dcterms:modified">2019-01-01T12:00:00Z</meta>
<link rel="record" href="onix.xml" media-type="application/xml" properties="onix"/>
<link rel="record" href="xmp.xml" media-type="application/xml" properties="xmp"/>
<link rel="record" href="other.xml" media-type="application/xml" properties="my:type"/>
</metadata>
<manifest>
Expand Down
17 changes: 12 additions & 5 deletions src/test/resources/epub3/D-vocabularies/metadata-link.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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

0 comments on commit 6a3d2a6

Please sign in to comment.