error rsc-005 has me stumped

5 posts / 0 new
Last post

working through completion of a illustrated epub. This error has occurred on all of the svg images included in epub3 publication. I can't understand what the error means.

ERROR RSC-005 /OEBPS/image/bee_icon_InCircle.svg
(line 1, col 157) Error while parsing file 'element "style" missing required attribute "type"'.

here is line 1 of the svg file:

<svg id="Layer_3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144 144"><title>icon of a bee</title><desc>the voice of the bee is symbolized by the icon</desc><style>.st0{fill:#00D024;} .st1{fill:#999999;} .st2{fill:#F1CC00;} .st3{opacity:0.6;fill:#FFFFFF;stroke:#998675;stroke-width:1.2;stroke-miterlimit:10;} .st4{fill:#FFDF05;} .st5{fill:#00022B;} .st6{fill:#534741;} .st7{fill:#736357;} .st8{fill:#FFFFFF;} .st9{opacity:0.6;fill:#FFFFFF;stroke:#998675;stroke-width:1.5;stroke-miterlimit:10;}</style>

I've combed all of the net to try to figure out what the EPUBcheck requires here but can't find anything. I'm developing illustration in Illustrator, saving as svg and optimizing using an online tool.

Any guesses, anyone?
thanks in advance

I find it annoyingly hard to understand attributes the SVG specification, but it seems to be the case that a type attribute is required on the element.

The prose never comes out and says that it's required, but if you look at the DTD definition it indicates it is and that the other attributes are implied:

<!ATTLIST %SVG.style.qname;
    xml:space ( preserve ) #FIXED 'preserve'
    %SVG.id.attrib;
    %SVG.base.attrib;
    %SVG.lang.attrib;
    %SVG.Core.extra.attrib;
    type %ContentType.datatype; #REQUIRED
    media %MediaDesc.datatype; #IMPLIED
    title %Text.datatype; #IMPLIED
>

I initially would have read it as a bug between specification and DTD conformance, especially since the prose talks about fallbacks when absent, but maybe that's just error handling or how to treat the attribute if it's empty?

I hate specifications that don't state upfront whether elements and attributes are required or not, though, so maybe it is a bug.

At any rate, you need to add a type attribute to make epubcheck happy, and maybe see if the optimizer is stripping it.

Thanks Matt:
My solution is as follows:

<svg id="Layer_3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 144 144">
<title>icon of a bee</title><desc>the voice of the bee is symbolized by the icon</desc><style type="text/css">.st0{fill:#00D024;} .st1{fill:#999999;} .st2{fill:#F1CC00;} .st3{opacity:0.6;fill:#FFFFFF;stroke:#998675;stroke-width:1.2;stroke-miterlimit:10;} .st4{fill:#FFDF05;} .st5{fill:#00022B;} .st6{fill:#534741;} .st7{fill:#736357;} .st8{fill:#FFFFFF;} .st9{opacity:0.6;fill:#FFFFFF;stroke:#998675;stroke-width:1.5;stroke-miterlimit:10;}</style>

essentially, I have added type="text/css" onto <style> tag
I don't understand why this is a requirement... but it has eliminated the error.

svg in EPUB3 is still a learning curve.

It looks like it is an error in the DTD. I found this thread the SVG mailing list:

https://lists.w3.org/Archives/Public/www-svg/2005Jan/0096.html

I'll open an issue in epubcheck to loosen the requirement, but it won't help you in the near term.

The SVG problem seems to result from a backwards incompatible change in the second edition of SVG 1.1. (Unfortunately it has no own version number, therefore all incompatible changes result in ambiguous situations, there are a few more of these problematic changes resulting in undefined issues).

In 1.0 and the first edition of 1.1 the contentStyleType attribute of the root element was only responsible for style attributes (to be avoided anyway in good documents), not for style elements.
Therefore obviously it is relevant and important to require the styling language used in the style element.

The second edition however seems to assume, that contentStyleType applies for any styling in the document with no type explicitly given.

Typically in SVG documents I try to use the presentation attributes instead of properties.
If I provide different alternative styles for one SVG document, I prefer to use external stylesheet documents as for XHTML as well.

Due to the inconsistency in the different versions of SVG recommendations it is always a good idea to set the type attribute, if the style element is used.
In the few other cases as well is is a good idea to avoid the problematic issues with clear notation to avoid undefined fragments in documents.

Secondary menu