GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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
Filter options
  • src
    • main/resources/com/adobe/epubcheck/schema/30
      • package-30.rnc
    • test/resources/epub3
      • files/package-document
        • lang-empty-valid.opf
      • package-document.feature
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/main/resources/com/adobe/epubcheck/schema/30/package-30.rnc‎

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 numberDiff line numberDiff line change
@@ -128,5 +128,5 @@
128128
opf.href.attr = attribute href { datatype.URI }
129129
opf.id.attr = attribute id { datatype.ID }
130130
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 }
132132
opf.dir.attr = attribute dir { 'ltr' | 'rtl' }
Collapse file

‎src/test/resources/epub3/files/package-document/lang-empty-valid.opf‎

Copy file name to clipboard
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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

‎src/test/resources/epub3/package-document.feature‎

Copy file name to clipboardExpand all lines: src/test/resources/epub3/package-document.feature
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Feature: EPUB 3 ▸ Packages ▸ Package Document Checks
3030
Then fatal error RSC-016 is reported (parsing error)
3131
And error RSC-005 is reported (schema error)
3232
And no other errors or warnings are reported
33-
34-
33+
34+
3535
# 3.4 Pacakge Document Definition
3636

3737
## 3.4.1 The package element
@@ -86,6 +86,10 @@ Feature: EPUB 3 ▸ Packages ▸ Package Document Checks
8686
When checking file 'id-duplicate-with-spaces-error.opf'
8787
Then error RSC-005 is reported 2 times (once for each ID)
8888
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
8993

9094
## 3.4.3 Metadata
9195
### 3.4.3 The metadata element

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.