Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDF metada <rdf:RDF> in SVG #173

Closed
rdeltour opened this issue Oct 15, 2013 · 8 comments
Closed

RDF metada <rdf:RDF> in SVG #173

rdeltour opened this issue Oct 15, 2013 · 8 comments
Labels
status: completed Work completed, can be closed type: false-positive This issue is about valid content being incorrectly rejected
Milestone

Comments

@rdeltour
Copy link
Member

From [email protected] on April 29, 2012 14:26:31

PROBLEM: I have been using SVG inserts to scale elements in ePUB documents. The files validate cleanly in every detail, except that ePUBcheck flags up <rdf:RDF> as invalid. Looking at the W3C website I don't think this is correct. It is valid. The files work perfectly, so perhaps this is a bug in ePUBcheck? This was with version 3.0b4.

METHOD: What steps will reproduce the problem?

  1. include an SVG image in the flow of the document, correctly inside a <div> tag.
  2. Make sure there are no errors at all in the ePUB, then make sure that the plain SVG contains <rdf:RDF> metadata, which typically it will.
  3. run the file through ePUBcheck version 3.0b4.

RESULT: ePUBcheck correctly identifies that the file is in fact ePUB 2.01. Everything passes validation, except for each SVG file the <rdf:RDF> element is said to be invalid.

EXPECTED: As far as I can see it isn't invalid, so I would expect a complete 'No errors' result.

PLATFORM: This was with version 3.0b4. I stopped using version 1.2 because that said there was a font type specification error in the .opf file that also didn't seem to be correct and because I am beginging to develop for ePUB 3. Version 3.0b4 does not report the font error, so presumably that has been fixed.

I am using Windows 7 64 bit

ADDITIONAL INFO: My objective is to create beautiful eBooks as eBooks, not as fallout from print, so I am probably pushing the boundaries of what may be done with ePUB 2.01; however, everything I do is validated by other checks and the files work well in all the major e-readers on the market, in desktop testing and on the iPad.

I haven't tried version 3.0b5 yet. This doesn't seem to be amont the fixes listed though.

Original issue: http://code.google.com/p/epubcheck/issues/detail?id=173

@rdeltour
Copy link
Member Author

From [email protected] on October 11, 2012 14:06:19

The schema for SVG 1.1 referenced by the EPUB 3 spec and used by EPUBCheck is known to be incomplete. It is correct that the svg metadata elements allows any content including RDF, and the validation wrongly reports this as an error. The fix of the schema will hopefully be part of the upcoming minor revision to EPUB, and will then be used by EPUBCheck. For now, ignore this error report.

Status: Accepted
Labels: Type-Defect Priority-Medium

@dClauzel
Copy link

dClauzel commented Nov 2, 2013

In a document, I am using the ePub logo from IDPF : https://en.wikipedia.org/wiki/File:EPUB_logo.svg

The definition in the OPF file is:

<manifest>
  <item id="image.logo_epub" href="images/EPUB_logo.svg" media-type="image/svg+xml"/>
</manifest>

Use in the document is:

<img src="images/EPUB_logo.svg" title="logo ePub de l'IDPF"/>

However, I get the following errors. Are they related to the same problem?

ERROR: essai.epub/EPUB/images/EPUB_logo.svg: External DTD entities are not allowed. Remove the DOCTYPE.
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(60,31): External entities are not allowed. External entity declaration found: %svg-model.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(65,33): External entities are not allowed. External entity declaration found: %svg-attribs.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(72,33): External entities are not allowed. External entity declaration found: %svg-framework.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(103,33): External entities are not allowed. External entity declaration found: %svg-datatypes.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(197,29): External entities are not allowed. External entity declaration found: %svg-qname.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(865,35): External entities are not allowed. External entity declaration found: %svg-core-attrib.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(923,40): External entities are not allowed. External entity declaration found: %svg-container-attrib.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(968,39): External entities are not allowed. External entity declaration found: %svg-viewport-attrib.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(1018,36): External entities are not allowed. External entity declaration found: %svg-paint-attrib.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(1139,38): External entities are not allowed. External entity declaration found: %svg-opacity-attrib.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(1191,39): External entities are not allowed. External entity declaration found: %svg-graphics-attrib.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(1268,40): External entities are not allowed. External entity declaration found: %svg-docevents-attrib.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(1335,42): External entities are not allowed. External entity declaration found: %svg-graphevents-attrib.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(1423,41): External entities are not allowed. External entity declaration found: %svg-animevents-attrib.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(1480,36): External entities are not allowed. External entity declaration found: %svg-xlink-attrib.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(1568,43): External entities are not allowed. External entity declaration found: %svg-extresources-attrib.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(1612,33): External entities are not allowed. External entity declaration found: %svg-structure.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(1961,35): External entities are not allowed. External entity declaration found: %svg-conditional.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(2102,29): External entities are not allowed. External entity declaration found: %svg-image.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(2203,29): External entities are not allowed. External entity declaration found: %svg-style.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(2292,29): External entities are not allowed. External entity declaration found: %svg-shape.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(2619,28): External entities are not allowed. External entity declaration found: %svg-text.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(3055,30): External entities are not allowed. External entity declaration found: %svg-marker.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(3198,31): External entities are not allowed. External entity declaration found: %svg-profile.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(3279,32): External entities are not allowed. External entity declaration found: %svg-gradient.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(3437,31): External entities are not allowed. External entity declaration found: %svg-pattern.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(3572,28): External entities are not allowed. External entity declaration found: %svg-clip.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(3681,28): External entities are not allowed. External entity declaration found: %svg-mask.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(3822,30): External entities are not allowed. External entity declaration found: %svg-filter.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(4637,30): External entities are not allowed. External entity declaration found: %svg-cursor.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(4723,33): External entities are not allowed. External entity declaration found: %svg-hyperlink.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(4854,28): External entities are not allowed. External entity declaration found: %svg-view.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(4926,30): External entities are not allowed. External entity declaration found: %svg-script.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(4997,33): External entities are not allowed. External entity declaration found: %svg-animation.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(5283,28): External entities are not allowed. External entity declaration found: %svg-font.mod
ERROR: essai.epub/EPUB/images/EPUB_logo.svg(5669,37): External entities are not allowed. External entity declaration found: %svg-extensibility.mod

The source of the logo is:

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="160px" height="220px" viewBox="0 0 160 220">
<g>
        <path fill="#85B916" d="M31.479,214.286c3.275,0,5.592-1.34,7.529-3.372l2.211,1.989c-2.396,2.678-5.307,4.479-9.833,4.479
                c-6.563,0-11.914-5.037-11.914-12.473c0-6.926,4.849-12.471,11.456-12.471c7.059,0,11.127,5.635,11.127,12.656
                c0,0.325,0,0.693-0.044,1.108H23.07C23.578,211.379,27.275,214.286,31.479,214.286z M38.458,203.57
                c-0.372-4.341-2.867-8.13-7.629-8.13c-4.148,0-7.294,3.468-7.759,8.13H38.458z"/>
        <path fill="#41291D" d="M60.391,205.419h-7.852v11.41h-3.647v-32.335h12.105c7.294,0,12.1,3.882,12.1,10.303
                C73.097,201.818,67.275,205.419,60.391,205.419z M60.712,187.867h-8.173v14.224h7.994c5.355,0,8.866-2.861,8.866-7.158
                C69.399,190.27,65.938,187.867,60.712,187.867z M106.162,203.013c0,9.425-5.399,14.322-13.486,14.322
                c-7.988,0-13.437-4.896-13.437-14.042v-18.799h3.646v18.569c0,6.973,3.697,10.901,9.889,10.901c5.957,0,9.747-3.606,9.747-10.671
                v-18.799h3.641V203.013z M138.731,192.579c0,4.248-2.588,6.419-5.127,7.53c3.833,1.151,6.923,3.368,6.923,7.852
                c0,5.584-4.663,8.868-11.728,8.868h-14.595v-32.335h13.994C134.57,184.493,138.731,187.632,138.731,192.579z M135.035,193.087
                c0-3.235-2.545-5.313-7.158-5.313h-10.074v11.134h9.795C131.982,198.908,135.035,196.92,135.035,193.087z M136.837,207.729
                c0-3.558-2.96-5.589-8.595-5.589h-10.439v11.406h11.09C133.79,213.545,136.837,211.379,136.837,207.729z"/>
</g>
<path fill="#85B916" d="M79.998,130.406l-49.316-49.32l49.316-49.313l16.44,16.437l-32.88,32.876l16.439,16.44l49.316-49.313
        l-42.96-42.96c-3.508-3.511-9.198-3.511-12.709,0L4.161,74.736c-3.508,3.508-3.508,9.198,0,12.709l69.484,69.481
        c3.511,3.511,9.201,3.511,12.709,0l69.484-69.481c3.508-3.511,3.508-9.201,0-12.709l-10.087-10.084L79.998,130.406z"/>
</svg>

@rdeltour rdeltour added this to the 4.0-beta1 milestone Aug 15, 2014
@rdeltour
Copy link
Member Author

Not sure this is still an issue. The External DTD entities are not allowed sound legit in EPUB 3. Needs further review of the original issue.

@rdeltour rdeltour removed this from the 4.0 milestone Aug 28, 2015
@rdeltour rdeltour added status: needs review Needs to be reviewed by a team member before further processing and removed type: bug The issue describes a bug labels Aug 28, 2015
@ptmkenny
Copy link

ptmkenny commented Jun 3, 2018

This is an old thread, but I'm getting the same error (with epubcheck 4.0.2:

ERROR(RSC-005): ..epub/EPUB/media/file0.svg(13,14): Error while parsing file 'element "rdf:RDF" not allowed anywhere; expected the element end-tag or text'.

The RDF data was added when I took an emoji SVG from the Twitter twemoji collection (https://github.com/twitter/twemoji) and exported it as a plain SVG from Inkscape.

However, as noted in the OP, this SVG is fine; it appears on iPad, Kindle, and various Mac/PC reading apps, but nevertheless epubcheck throws an error about rdf:RDF.

@rdeltour rdeltour removed the imported label Nov 12, 2018
@rdeltour
Copy link
Member Author

Closing this issue, as foreign elements are now allowed since #970.
Feel free to reopenIf this is still an issue for you in 4.2.0-beta.

@rdeltour rdeltour removed the status: needs review Needs to be reviewed by a team member before further processing label Feb 26, 2019
@mattgarrish
Copy link
Member

I tried to incorporate the commented-out test for this but am still getting the error.

@mattgarrish mattgarrish reopened this Mar 13, 2020
@mattgarrish
Copy link
Member

Looking closer at the test, the rdf element is disallowed when the svg is embedded in an xhtml document, but if I split it off into an svg doc the error goes away.

I'm going to add a working svg test, but it should also be valid in html. When I run the test through validator.nu it only warns that it does not validate rdf.

@rdeltour rdeltour added status: ready for implem The issue is ready to be implemented type: false-positive This issue is about valid content being incorrectly rejected labels Nov 13, 2021
@rdeltour rdeltour added this to the v5.0.0-beta-1 milestone Nov 13, 2021
@rdeltour rdeltour added status: in progress The issue is being implemented by the development team and removed status: ready for implem The issue is ready to be implemented labels Jan 23, 2022
@rdeltour rdeltour added status: completed Work completed, can be closed and removed status: in progress The issue is being implemented by the development team labels Sep 22, 2022
@rdeltour
Copy link
Member Author

rdeltour commented Dec 8, 2022

The SVG doctype is allowed since #1367, and we do have a passing test for using RDF metadata in XHTML+SVG. Closing this as completed. Feel free to reopen if the issue still happens after v5.0.0.

@rdeltour rdeltour closed this as completed Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: completed Work completed, can be closed type: false-positive This issue is about valid content being incorrectly rejected
Projects
None yet
Development

No branches or pull requests

4 participants