GeezerVison is showing github.com — fix: allow empty `xml:lang` attributes in Package Documents · w3c/epubcheck@177af8f
File tree
Expand file treeCollapse file tree
Open diff view settings
main/resources/com/adobe/epubcheck/schema/30
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/main/resources/com/adobe/epubcheck/schema/30/package-30.rnc +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
128 | 128 | opf.href.attr = attribute href { datatype.URI } |
129 | 129 | opf.id.attr = attribute id { datatype.ID } |
130 | 130 | opf.i18n.attrs = opf.xml.lang.attr? & opf.dir.attr? |
131 | | - opf.xml.lang.attr = attribute xml:lang { datatype.languagecode } |
| 131 | + opf.xml.lang.attr = attribute xml:lang { "" | datatype.languagecode } |
132 | 132 | opf.dir.attr = attribute dir { 'ltr' | 'rtl' } |
Collapse file
Copy file name to clipboard +17Lines changed: 17 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" |
| 3 | + xmlns:dc="http://purl.org/dc/elements/1.1/"> |
| 4 | + <metadata> |
| 5 | + <dc:title>Title</dc:title> |
| 6 | + <dc:language>en</dc:language> |
| 7 | + <dc:identifier id="uid">NOID</dc:identifier> |
| 8 | + <meta property="dcterms:modified">2019-01-01T12:00:00Z</meta> |
| 9 | + <dc:creator xml:lang="">Jane Doe</dc:creator> |
| 10 | + </metadata> |
| 11 | + <manifest> |
| 12 | + <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml"/> |
| 13 | + </manifest> |
| 14 | + <spine> |
| 15 | + <itemref idref="t001"/> |
| 16 | + </spine> |
| 17 | +</package> |
Collapse file
Copy file name to clipboardExpand all lines: src/test/resources/epub3/package-document.feature +6-2Lines changed: 6 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -30,8 +30,8 @@ Feature: EPUB 3 ▸ Packages ▸ Package Document Checks |
30 | 30 | Then fatal error RSC-016 is reported (parsing error) |
31 | 31 | And error RSC-005 is reported (schema error) |
32 | 32 | And no other errors or warnings are reported |
33 | | - |
34 | | - |
| 33 | + |
| 34 | + |
35 | 35 | # 3.4 Pacakge Document Definition |
36 | 36 |
|
37 | 37 | ## 3.4.1 The package element |
@@ -86,6 +86,10 @@ Feature: EPUB 3 ▸ Packages ▸ Package Document Checks |
86 | 86 | When checking file 'id-duplicate-with-spaces-error.opf' |
87 | 87 | Then error RSC-005 is reported 2 times (once for each ID) |
88 | 88 | And no other errors or warnings are reported |
| 89 | + |
| 90 | + Scenario: the `xml:lang` attribute can be empty |
| 91 | + When checking file 'lang-empty-valid.opf' |
| 92 | + Then no other errors or warnings are reported |
89 | 93 |
|
90 | 94 | ## 3.4.3 Metadata |
91 | 95 | ### 3.4.3 The metadata element |
|