-
Notifications
You must be signed in to change notification settings - Fork 408
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable informative (USAGE) checking of SVG content conformance
This commit re-enables SVG content conformance checking: * new NVDL and RelaxNG schema drivers will only check SVG content, and ignore other namespaces. * these informative schemas are enabled for both SVG and XHTML Content Documents * SVG content conformance, as before, is using RelaxNG schemas from the Nu HTML Checker.
- Loading branch information
Showing
6 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-informative.nvdl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"> | ||
<namespace ns="http://www.w3.org/2000/svg"> | ||
<validate schema="epub-svg-informative.rnc" schemaType="application/relax-ng-compact-syntax"/> | ||
</namespace> | ||
<namespace ns="" match="attributes"> | ||
<attach/> | ||
</namespace> | ||
<anyNamespace match="elements attributes"> | ||
<allow/> | ||
</anyNamespace> | ||
</rules> |
30 changes: 30 additions & 0 deletions
30
src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-informative.rnc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
namespace svg = "http://www.w3.org/2000/svg" | ||
|
||
include "./mod/epub-xhtml.rnc" { | ||
# This schema applies both to XHTML and SVG documents | ||
start = svg | html.elem | ||
} | ||
include "./mod/svg11/svg11-inc.rnc" { | ||
# ID datatype is set here to the lower HTML requirements, | ||
# proper checking is done by the normative schema | ||
SVG.id.attrib = attribute id { datatype.html5.token }? | ||
} | ||
include "./mod/svg11/inkscape.rnc" | ||
|
||
## EPUB-specific additions: | ||
|
||
SVG.Core.attrib &= aria.global? | ||
SVG.Core.extra.attrib &= epub.type.attr? | ||
|
||
## Do not check restricted elements, they are checked in normative schemas | ||
SVG.foreignObject.content |= any.content | ||
SVG.title.content |= any.content | ||
|
||
## Anything | ||
|
||
## Any attribute from any namespace, other than the special cases | ||
any.attr = attribute * { text }* | ||
## Any element from any namespace, other than the special cases | ||
any.elem = element * { any.content & any.attr } | ||
## Any content from any namespace | ||
any.content = text & any.elem* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters