Skip to content

Commit

Permalink
Change style/@type to optional in the SVG Schema/DTD to fix #688
Browse files Browse the repository at this point in the history
  • Loading branch information
tofi86 committed Jun 6, 2017
1 parent 54ff35b commit 275f6b6
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2272,10 +2272,16 @@

<!ENTITY % SVG.style.attlist "INCLUDE" >
<![%SVG.style.attlist;[
<!--
EpubCheck bugfix #688
- https://github.com/IDPF/epubcheck/issues/688
Changing @type from #REQUIRED to #IMPLIED
fixes a bug in the original SVG 1.1 DTD
-->
<!ATTLIST %SVG.style.qname;
xml:space ( preserve ) #FIXED 'preserve'
%SVG.Core.attrib;
type %ContentType.datatype; #REQUIRED
type %ContentType.datatype; #IMPLIED
media %MediaDesc.datatype; #IMPLIED
title %Text.datatype; #IMPLIED
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,18 @@
<ref name="SVG.id.attrib"/>
<ref name="SVG.base.attrib"/>
<ref name="SVG.lang.attrib"/>
<ref name="SVG.Core.extra.attrib"/>
<attribute name="type">
<ref name="SVGContentType.datatype"/>
</attribute>
<ref name="SVG.Core.extra.attrib"/>
<optional>
<!--
EpubCheck bugfix #688
- https://github.com/IDPF/epubcheck/issues/688
Changing @type to <optional> fixes a bug
in the original SVG 1.1 Schema
-->
<attribute name="type">
<ref name="SVGContentType.datatype"/>
</attribute>
</optional>
<optional>
<attribute name="media">
<ref name="SVGMediaDesc.datatype"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ style =
SVG.base.attrib,
SVG.lang.attrib,
SVG.Core.extra.attrib,
attribute type { ContentType.datatype },
attribute type { ContentType.datatype }?,
attribute media { MediaDesc.datatype }?,
attribute title { Text.datatype }?,
SVG.style.content
Expand Down
6 changes: 6 additions & 0 deletions src/test/java/com/adobe/epubcheck/ops/OPSCheckerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,12 @@ public void testValidateSVG_Links()
testValidateDocument("svg/valid/svg-links.svg", "image/svg+xml", EPUBVersion.VERSION_3);
}

@Test
public void testValidateSVG_ValidStyleWithoutType_issue688()
{
testValidateDocument("svg/valid/issue688.svg", "image/svg+xml", EPUBVersion.VERSION_3);
}

@Test
public void testValidateSVG_Links_MisssingTitle()
{
Expand Down
17 changes: 17 additions & 0 deletions src/test/resources/30/single/svg/valid/issue688.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 275f6b6

Please sign in to comment.