diff --git a/src/main/java/com/adobe/epubcheck/opf/XRefChecker.java b/src/main/java/com/adobe/epubcheck/opf/XRefChecker.java index e8582bce3..038d3028e 100755 --- a/src/main/java/com/adobe/epubcheck/opf/XRefChecker.java +++ b/src/main/java/com/adobe/epubcheck/opf/XRefChecker.java @@ -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 @@ -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)) diff --git a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties index 526f1b90c..e3bc2b285 100644 --- a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties +++ b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties @@ -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. diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/listSeverities_expected_results.txt b/src/test/resources/com/adobe/epubcheck/test/command_line/listSeverities_expected_results.txt index d72aef564..4273034c9 100644 --- a/src/test/resources/com/adobe/epubcheck/test/command_line/listSeverities_expected_results.txt +++ b/src/test/resources/com/adobe/epubcheck/test/command_line/listSeverities_expected_results.txt @@ -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. diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.json index bb4be2d60..78e0a7843 100644 --- a/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.json +++ b/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.json @@ -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 }, @@ -683,18 +683,13 @@ }, { "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, @@ -702,5 +697,17 @@ "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 } ] -} +} \ No newline at end of file diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.xmp b/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.xmp index 08d4f9ac8..de1b0fddd 100644 --- a/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.xmp +++ b/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.xmp @@ -20,7 +20,7 @@ - 2015-03-30T16:15:02+02:00 + 2016-12-18T16:57:07+01:00 Not well-formed @@ -52,15 +52,22 @@ - RSC-007, ERROR, Referenced resource could not be found in the EPUB. + RSC-007, ERROR, Referenced resource 'OPS/fonts/badaboom.woff' could not be found in the EPUB. - + + RSC-007, ERROR, Referenced resource 'OPS/styles/fonts/bloody.woff' could not be found in the EPUB. + + + + + + CSS-019, WARN, CSS font-face declaration has no attributes. @@ -206,7 +213,7 @@ - epubcheck 4.0.0-alpha12-SNAPSHOT + epubcheck 4.0.3-SNAPSHOT diff --git a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.json index e7cbdc319..bd40342bf 100644 --- a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.json +++ b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.json @@ -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", diff --git a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.xml index 946267520..f9b83ea38 100644 --- a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.xml +++ b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.xml @@ -10,7 +10,7 @@ RSC-001, ERROR, [File 'OPS Content/Cyrillic_phi.html' could not be found.], interesting_paths_epub3.epub RSC-001, ERROR, [File 'OPS Content/style.' could not be found.], interesting_paths_epub3.epub - RSC-007, ERROR, [Referenced resource could not be found in the EPUB.], OPS Content/More XHTML Content/page01.xhtml (13-35) + 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) PKG-009, ERROR, [File name contains characters that are not allowed in OCF file names: '"{","}"'.], OPS Content/page{03}.xhtml HTM-014a, WARN, [XHTML Content Document file name 'OPS Content/Cyrillic_phi.html' should have the extension '.xhtml'.], OPS Content/content.opf (14-86) 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 diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/hyperlinks_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/hyperlinks_expected_results.json index 90abbbc6b..29b7283aa 100644 --- a/src/test/resources/com/adobe/epubcheck/test/xhtml/hyperlinks_expected_results.json +++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/hyperlinks_expected_results.json @@ -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", diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/namespaces_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/namespaces_expected_results.json index 009c429ff..00c34efd6 100644 --- a/src/test/resources/com/adobe/epubcheck/test/xhtml/namespaces_expected_results.json +++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/namespaces_expected_results.json @@ -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",