GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: report fatal XML parsing errors only once as RSC-016 · w3c/epubcheck@62d67e7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • main/java/com/adobe/epubcheck/xml
      • XMLParser.java
    • test
      • java/com/adobe/epubcheck/ocf
        • OPFPeekerTest.java
      • resources/epub3
        • 03-resources
          • resources.feature
        • 06-content-document
          • content-document-xhtml.feature
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/main/java/com/adobe/epubcheck/xml/XMLParser.java‎

Copy file name to clipboardExpand all lines: src/main/java/com/adobe/epubcheck/xml/XMLParser.java
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ public void process()
162162
report.message(MessageId.PKG_008, EPUBLocation.of(context), context.path);
163163
} catch (SAXException e)
164164
{
165-
report.message(MessageId.RSC_005, EPUBLocation.of(context), e.getMessage());
165+
// All errors should have already been reported by the error handler
166+
if (report.getFatalErrorCount() == 0) {
167+
report.message(MessageId.RSC_016, EPUBLocation.of(context), e.getMessage());
168+
}
166169
}
167170
}
168171

Collapse file

‎src/test/java/com/adobe/epubcheck/ocf/OPFPeekerTest.java‎

Copy file name to clipboardExpand all lines: src/test/java/com/adobe/epubcheck/ocf/OPFPeekerTest.java
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,16 @@ public void testRetrieveVersionNoVersionAttribute()
151151
@Test
152152
public void testRetrieveVersionNoEqualSign()
153153
{
154-
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
154+
Collections.addAll(expectedErrors, MessageId.RSC_005);
155+
Collections.addAll(expectedFatals, MessageId.RSC_016);
155156
retrieveData("noEqual.opf");
156157
}
157158

158159
@Test
159160
public void testRetrieveVersionValueWithoutQuotes()
160161
{
161-
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
162+
Collections.addAll(expectedErrors, MessageId.RSC_005);
163+
Collections.addAll(expectedFatals, MessageId.RSC_016);
162164
retrieveData("valueWithoutQuotes.opf");
163165
}
164166

Collapse file

‎src/test/resources/epub3/03-resources/resources.feature‎

Copy file name to clipboardExpand all lines: src/test/resources/epub3/03-resources/resources.feature
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,14 +392,12 @@
392392
Scenario: a not well-formed Package Document is reported
393393
When checking file 'conformance-xml-malformed-error.opf'
394394
Then fatal error RSC-016 is reported (parsing error)
395-
And error RSC-005 is reported (schema error)
396395
And no other errors or warnings are reported
397396

398397
@spec @xref:sec-xml-constraint
399398
Scenario: using a not-declared namespace is not allowed
400399
When checking file 'conformance-xml-undeclared-namespace-error.opf'
401400
Then fatal error RSC-016 is reported (parsing error)
402-
And error RSC-005 is reported (schema error)
403401
And no other errors or warnings are reported
404402

405403
Scenario: Verify an attribute value with leading/trailing whitespace is allowed (issue 332)
Collapse file

‎src/test/resources/epub3/06-content-document/content-document-xhtml.feature‎

Copy file name to clipboardExpand all lines: src/test/resources/epub3/06-content-document/content-document-xhtml.feature
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,12 @@ Feature: EPUB 3 — Content Documents — XHTML
9191
Scenario: Report entity references not ending with a semicolon
9292
When checking document 'entities-no-semicolon-error.xhtml'
9393
Then fatal error RSC-016 is reported
94-
And error RSC-005 is reported
9594
And the message contains 'must end with the \';\' delimiter'
9695
And no other errors or warnings are reported
9796

9897
Scenario: Report unknown entity references
9998
When checking document 'entities-unknown-error.xhtml'
10099
Then fatal error RSC-016 is reported
101-
And error RSC-005 is reported
102100
And the message contains 'was referenced, but not declared'
103101
And no other errors or warnings are reported
104102

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.