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 — feat: check `epub:type` restrictions in XHTML and SVG · w3c/epubcheck@0fab5c8

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • main
      • java/com/adobe/epubcheck
        • ops
          • OPSChecker.java
        • xml
          • XMLValidators.java
      • resources/com/adobe/epubcheck/schema/30
        • epub-nav-30.rnc
        • epub-svg-30-informative.nvdl
        • epub-svg-30-informative.rnc
        • epub-svg-30.rnc
        • epub-svg-informative.rnc
        • epub-xhtml-30.rnc
        • mod
          • epub-mathml3-inc.rnc
          • epub-prefix-attr.rnc
          • epub-shared-inc.rnc
          • epub-ssml-attrs.rnc
          • epub-svg-forgiving-inc.rnc
          • epub-svg-inc.rnc
          • epub-svg-strict-inc.rnc
          • epub-switch.rnc
          • epub-trigger.rnc
          • epub-type-attr.rnc
          • epub-xhtml-inc.rnc
          • epub-xhtml-integration.rnc
          • epub-xhtml-mathml3.rnc
          • epub-xhtml-svg-mathml.rnc
          • epub-xhtml-svg11.rnc
          • epub-xhtml.rnc
    • test/resources
      • epub-region-nav
        • region-nav-publication.feature
      • epub3
        • 00-minimal/files/minimal/EPUB
          • content_001.xhtml
        • 06-content-document
          • content-document-svg.feature
          • content-document-xhtml.feature
          • files
            • epubtype-not-allowed-error.svg
            • epubtype-on-non-palpable-content-error.xhtml
            • epubtype-valid.svg
            • svg-invalid-usage.svg
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/main/java/com/adobe/epubcheck/ops/OPSChecker.java‎

Copy file name to clipboardExpand all lines: src/main/java/com/adobe/epubcheck/ops/OPSChecker.java
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ public class OPSChecker extends PublicationResourceChecker
5656
.putAll(Predicates.and(mimetype("application/xhtml+xml"), version(EPUBVersion.VERSION_2)),
5757
XMLValidators.XHTML_20_NVDL, XMLValidators.XHTML_20_SCH, XMLValidators.IDUNIQUE_20_SCH)
5858
.putAll(Predicates.and(mimetype("application/xhtml+xml"), version(EPUBVersion.VERSION_3)),
59-
XMLValidators.XHTML_30_NVDL, XMLValidators.SVG_INFORMATIVE_30_NVDL)
59+
XMLValidators.XHTML_30_NVDL, XMLValidators.SVG_30_INFORMATIVE_NVDL)
6060
.putAll(Predicates.and(mimetype("image/svg+xml"), version(EPUBVersion.VERSION_2)),
6161
XMLValidators.SVG_20_NVDL, XMLValidators.IDUNIQUE_20_SCH)
6262
.putAll(Predicates.and(mimetype("image/svg+xml"), version(EPUBVersion.VERSION_3)),
63-
XMLValidators.SVG_30_NVDL, XMLValidators.SVG_INFORMATIVE_30_NVDL)
63+
XMLValidators.SVG_30_NVDL, XMLValidators.SVG_30_INFORMATIVE_NVDL)
6464
.putAll(
6565
and(or(profile(EPUBProfile.DICT), hasPubType(PublicationType.DICTIONARY)),
6666
mimetype("application/xhtml+xml"), version(EPUBVersion.VERSION_3)),
Collapse file

‎src/main/java/com/adobe/epubcheck/xml/XMLValidators.java‎

Copy file name to clipboardExpand all lines: src/main/java/com/adobe/epubcheck/xml/XMLValidators.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public enum XMLValidators
3939
SVG_20_NVDL("schema/20/rng/ops20-svg.nvdl"),
4040
SVG_30_RNC("schema/30/epub-svg-30.rnc"),
4141
SVG_30_NVDL("schema/30/epub-svg-30.nvdl"),
42-
SVG_INFORMATIVE_30_NVDL("schema/30/epub-svg-informative.nvdl", false),
42+
SVG_30_INFORMATIVE_NVDL("schema/30/epub-svg-30-informative.nvdl", false),
4343
SVG_30_SCH("schema/30/epub-svg-30.sch"),
4444
XHTML_20_NVDL("schema/20/rng/ops20.nvdl"),
4545
XHTML_20_SCH("schema/20/sch/xhtml.sch"),
Collapse file

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

Copy file name to clipboardExpand all lines: src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.rnc
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
default namespace = "http://www.w3.org/1999/xhtml"
33
namespace epub = "http://www.idpf.org/2007/ops"
44

5+
6+
# #####################################################################
7+
## RELAX NG Schema for EPUB: EPUB Navigation Documents #
8+
# #####################################################################
9+
510
include "epub-xhtml-30.rnc" {
611
nav.attrs = nav.attrs.noepubtype
712
}
Collapse file

‎…heck/schema/30/epub-svg-informative.nvdl‎ ‎…k/schema/30/epub-svg-30-informative.nvdl‎src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-informative.nvdl renamed to src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-30-informative.nvdl src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-informative.nvdl renamed to src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-30-informative.nvdl

Copy file name to clipboardExpand all lines: src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-30-informative.nvdl
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0">
33
<namespace ns="http://www.w3.org/2000/svg">
4-
<validate schema="epub-svg-informative.rnc" schemaType="application/relax-ng-compact-syntax"/>
4+
<validate schema="epub-svg-30-informative.rnc" schemaType="application/relax-ng-compact-syntax"/>
55
</namespace>
66
<namespace ns="" match="attributes">
77
<attach/>
Collapse file

‎src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-30-informative.rnc‎

Copy file name to clipboard
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace svg = "http://www.w3.org/2000/svg"
2+
3+
# #####################################################################
4+
## RELAX NG Schema for EPUB: EPUB SVG and XHTML (+ MathML) #
5+
## strict SVG grammar check (informative only) #
6+
# #####################################################################
7+
8+
include "./mod/epub-xhtml-inc.rnc" {
9+
# This schema applies both to XHTML and SVG documents
10+
start = svg | html.elem
11+
}
12+
include "./mod/epub-svg-strict-inc.rnc"
13+
include "./mod/epub-mathml3-inc.rnc"
14+
include "./mod/epub-shared-inc.rnc"
15+
16+
common.elem.phrasing |= svg
17+
common.elem.phrasing |= math
Collapse file

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

Copy file name to clipboard
+10-13Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
namespace svg = "http://www.w3.org/2000/svg"
21

3-
include "./mod/epub-xhtml-inc.rnc" {
2+
# #####################################################################
3+
## RELAX NG Schema for EPUB: EPUB SVG (+ XHTML, + MathML) #
4+
# #####################################################################
5+
6+
include "./mod/epub-xhtml-svg-mathml.rnc" {
47
start = svg
8+
9+
# Override the `id` attribute to require a valid XML ID
10+
svg.attr.id = attribute id { xsd:ID }?
511
}
6-
include "./mod/epub-mathml3.rnc"
7-
include "./mod/epub-svg-inc.rnc"
8-
9-
svg.title.content |= common.inner.anyhtml
10-
11-
svg.foreignObject.content |=
12-
( body.elem
13-
| common.inner.flow
14-
| math
15-
)
1612

17-
mtext.content |= common.elem.phrasing
13+
# Allow `body` element as a child of `foreignObject`
14+
svg.foreignObject.inner |= body.elem
Collapse file

‎src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-informative.rnc‎

Copy file name to clipboardExpand all lines: src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-informative.rnc
-21Lines changed: 0 additions & 21 deletions
This file was deleted.
Collapse file

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

Copy file name to clipboard
+4-17Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
1-
namespace svg = "http://www.w3.org/2000/svg"
21

3-
include "./mod/epub-xhtml-inc.rnc"
4-
include "./mod/epub-mathml3.rnc"
5-
include "./mod/epub-svg-inc.rnc" {
6-
svg.attr.id = attribute id { datatype.html5.token }?
7-
}
2+
# #####################################################################
3+
## RELAX NG Schema for EPUB: EPUB XHTML (+ SVG, + MathML) #
4+
# #####################################################################
85

9-
common.elem.phrasing |= svg
10-
common.elem.phrasing |= math
11-
12-
math.attributes &= aria.global?
13-
14-
svg.title.content |= common.inner.anyhtml
15-
16-
svg.foreignObject.content |=
17-
( common.inner.flow
18-
| math
19-
)
6+
include "./mod/epub-xhtml-svg-mathml.rnc"
Collapse file

‎…epubcheck/schema/30/mod/epub-mathml3.rnc‎ ‎…check/schema/30/mod/epub-mathml3-inc.rnc‎src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-mathml3.rnc renamed to src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-mathml3-inc.rnc src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-mathml3.rnc renamed to src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-mathml3-inc.rnc

Copy file name to clipboardExpand all lines: src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-mathml3-inc.rnc
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,18 @@ include "mathml/mathml3-inc.rnc" {
2929
# override annotation-xml with EPUB restrictions
3030
annotation-xml = epub.annotation-xml
3131
}
32-
3332
# Common attribute extensions
3433
# - SSML attributes
3534
CommonAtt &= epub.ssml.ph.attr?
3635
# - xml:base
3736
CommonAtt &= common.attrs.xmlbase?
37+
# - ARIA
38+
CommonAtt &= aria.global?
3839

3940
annotation-xml.model.xhtml |= common.inner.flow
4041
annotation-xml.model.svg |= svg
4142

43+
4244
# The following comes from validator.nu’s xhtml5-svg-mathml.rnc driver:
4345
# in our integration, <mtext> is the only MathML "token element" that can
4446
# contain HTML element content; the <mi>, <mn>, <mo> and <ms> elements
@@ -84,4 +86,3 @@ epub.annotation-xml =
8486
attribute name {
8587
xsd:NCName
8688
}
87-
Collapse file

‎src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-prefix-attr.rnc‎

Copy file name to clipboard
+16-6Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11

2+
namespace epub = "http://www.idpf.org/2007/ops"
23

3-
namespace epub = "http://www.idpf.org/2007/ops"
4-
5-
html.attrs &= epub.prefix.attr.ns?
6-
7-
epub.prefix.attr = attribute prefix { datatype.prefixdecl }
8-
epub.prefix.attr.ns = attribute epub:prefix { datatype.prefixdecl }
4+
# #####################################################################
5+
## RELAX NG Schema for EPUB: EPUB prefix attributes #
6+
# #####################################################################
7+
8+
## prefix attributes
9+
10+
epub.prefix.attr =
11+
attribute prefix {
12+
datatype.prefixdecl
13+
}
14+
15+
epub.prefix.attr.ns =
16+
attribute epub:prefix {
17+
datatype.prefixdecl
18+
}

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.