Skip to content

Commit

Permalink
add resource in RSC-007 // fixes #475
Browse files Browse the repository at this point in the history
refs #720
  • Loading branch information
tofi86 authored and rdeltour committed Dec 20, 2016
1 parent 703b329 commit 71a76ee
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 24 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/adobe/epubcheck/opf/XRefChecker.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ private void checkReference(Reference ref)
else
{
report.message(MessageId.RSC_007w,
EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource),
ref.refResource);
}
}
else if (ref.refResource.matches("^[^:/?#]+://.*") && !(version == EPUBVersion.VERSION_3
Expand All @@ -264,7 +265,8 @@ else if (ref.refResource.matches("^[^:/?#]+://.*") && !(version == EPUBVersion.V
else if (!ocf.hasEntry(ref.refResource) && !ref.refResource.matches("^[^:/?#]+://.*"))
{
report.message(MessageId.RSC_007,
EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource),
ref.refResource);

}
else if (!undeclared.contains(ref.refResource))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ RSC_004=File '%1$s' could not be decrypted.
RSC_005=Error while parsing file '%1$s'.
RSC_006=Remote resource reference not allowed; resource must be placed in the OCF.
RSC_006_SUG=Only audio and video remote resources are permitted.
RSC_007=Referenced resource could not be found in the EPUB.
RSC_007w=Referenced resource could not be found in the EPUB.
RSC_007=Referenced resource '%1$s' could not be found in the EPUB.
RSC_007w=Referenced resource '%1$s' could not be found in the EPUB.
RSC_008=Referenced resource is not declared in the OPF manifest.
RSC_009=A fragment identifier should not be used with an img src attribute.
RSC_010=Reference to non-standard resource type found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ RSC-003 ERROR No rootfile tag with media type 'application/oebps-package+xml' wa
RSC-004 ERROR File '%1$s' could not be decrypted.
RSC-005 ERROR Error while parsing file '%1$s'.
RSC-006 ERROR Remote resource reference not allowed; resource must be placed in the OCF. Only audio and video remote resources are permitted.
RSC-007 ERROR Referenced resource could not be found in the EPUB.
RSC-007 ERROR Referenced resource '%1$s' could not be found in the EPUB.
RSC-008 ERROR Referenced resource is not declared in the OPF manifest.
RSC-009 ERROR A fragment identifier should not be used with an img src attribute.
RSC-010 ERROR Reference to non-standard resource type found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"checker" : {
"path" : "./target/test-classes/com/adobe/epubcheck/test/css/font-face.epub",
"filename" : "font-face.epub",
"checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
"checkDate" : "03-25-2015 10:06:37",
"elapsedTime" : 54,
"checkerVersion" : "4.0.3-SNAPSHOT",
"checkDate" : "12-18-2016 16:57:07",
"elapsedTime" : 53,
"nFatal" : 0,
"nError" : 4,
"nError" : 5,
"nWarning" : 1,
"nUsage" : 13
},
Expand Down Expand Up @@ -683,24 +683,31 @@
}, {
"ID" : "RSC-007",
"severity" : "ERROR",
"message" : "Referenced resource could not be found in the EPUB.",
"message" : "Referenced resource 'OPS/fonts/badaboom.woff' could not be found in the EPUB.",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/style_tag_css.xhtml",
"line" : 14,
"column" : 13,
"context" : "OPS/fonts/badaboom.woff"
}, {
"path" : "OPS/styles/style.css",
"line" : 23,
"column" : 5,
"context" : "OPS/styles/fonts/bloody.woff"
}, {
"path" : "OPS/styles/style.css",
"line" : 28,
"column" : 5,
"context" : "OPS/fonts/badaboom.woff"
} ],
"suggestion" : null
}, {
"ID" : "RSC-007",
"severity" : "ERROR",
"message" : "Referenced resource 'OPS/styles/fonts/bloody.woff' could not be found in the EPUB.",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/styles/style.css",
"line" : 23,
"column" : 5,
"context" : "OPS/styles/fonts/bloody.woff"
} ],
"suggestion" : null
} ]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</rdf:Bag>
</xmpTPg:Fonts>
<premis:hasEvent rdf:parseType="Resource">
<premis:hasEventDateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2015-03-30T16:15:02+02:00</premis:hasEventDateTime>
<premis:hasEventDateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2016-12-18T16:57:07+01:00</premis:hasEventDateTime>
<premis:hasEventType rdf:resource="http://id.loc.gov/vocabulary/preservation/eventType/val" />
<premis:hasEventDetail>Not well-formed</premis:hasEventDetail>
<premis:hasEventOutcomeInformation>
Expand Down Expand Up @@ -52,15 +52,22 @@
</premis:hasEventOutcomeDetail>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<premis:hasEventOutcome>RSC-007, ERROR, Referenced resource could not be found in the EPUB.</premis:hasEventOutcome>
<premis:hasEventOutcome>RSC-007, ERROR, Referenced resource 'OPS/fonts/badaboom.woff' could not be found in the EPUB.</premis:hasEventOutcome>
<premis:hasEventOutcomeDetail>
<rdf:Seq>
<rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (14-13)" />
<rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (23-5)" />
<rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (28-5)" />
</rdf:Seq>
</premis:hasEventOutcomeDetail>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<premis:hasEventOutcome>RSC-007, ERROR, Referenced resource 'OPS/styles/fonts/bloody.woff' could not be found in the EPUB.</premis:hasEventOutcome>
<premis:hasEventOutcomeDetail>
<rdf:Seq>
<rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (23-5)"/>
</rdf:Seq>
</premis:hasEventOutcomeDetail>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<premis:hasEventOutcome>CSS-019, WARN, CSS font-face declaration has no attributes.</premis:hasEventOutcome>
<premis:hasEventOutcomeDetail>
Expand Down Expand Up @@ -206,7 +213,7 @@
</premis:hasEventOutcomeInformation>
<premis:hasEventRelatedAgent rdf:parseType="Resource">
<premis:hasAgentType rdf:resource="http://id.loc.gov/vocabulary/preservation/agentType/sof" />
<premis:hasAgentName>epubcheck 4.0.0-alpha12-SNAPSHOT</premis:hasAgentName>
<premis:hasAgentName>epubcheck 4.0.3-SNAPSHOT</premis:hasAgentName>
</premis:hasEventRelatedAgent>
</premis:hasEvent>
<premis:hasSignificantProperties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@
}, {
"ID" : "RSC-007",
"severity" : "ERROR",
"message" : "Referenced resource could not be found in the EPUB.",
"message" : "Referenced resource 'OPS Content/Cyrillic_\u0424.xhtml' could not be found in the EPUB.",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS Content/More XHTML Content/page01.xhtml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<messages>
<message severity="error" subMessage="RSC-001">RSC-001, ERROR, [File 'OPS Content/Cyrillic_phi.html' could not be found.], interesting_paths_epub3.epub</message>
<message severity="error" subMessage="RSC-001">RSC-001, ERROR, [File 'OPS Content/style.' could not be found.], interesting_paths_epub3.epub</message>
<message severity="error" subMessage="RSC-007">RSC-007, ERROR, [Referenced resource could not be found in the EPUB.], OPS Content/More XHTML Content/page01.xhtml (13-35)</message>
<message severity="error" subMessage="RSC-007">RSC-007, ERROR, [Referenced resource 'OPS Content/Cyrillic_phi.html' could not be found in the EPUB.], OPS Content/More XHTML Content/page01.xhtml (13-35)</message>
<message severity="error" subMessage="PKG-009">PKG-009, ERROR, [File name contains characters that are not allowed in OCF file names: '"{","}"'.], OPS Content/page{03}.xhtml</message>
<message severity="error" subMessage="HTM-014a">HTM-014a, WARN, [XHTML Content Document file name 'OPS Content/Cyrillic_phi.html' should have the extension '.xhtml'.], OPS Content/content.opf (14-86)</message>
<message severity="error" subMessage="OPF-003">OPF-003, WARN, [Item 'OPS Content/Cyrillic_phi.xhtml' exists in the EPUB, but is not declared in the OPF manifest.], interesting_paths_epub3.epub</message>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@
}, {
"ID" : "RSC-007",
"severity" : "ERROR",
"message" : "Referenced resource could not be found in the EPUB.",
"message" : "Referenced resource 'OPS/' could not be found in the EPUB.",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/links.xhtml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
}, {
"ID" : "RSC-007",
"severity" : "ERROR",
"message" : "Referenced resource could not be found in the EPUB.",
"message" : "Referenced resource 'OPS/echild_s01_all.m4a' could not be found in the EPUB.",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/html5.xhtml",
Expand Down

0 comments on commit 71a76ee

Please sign in to comment.