Skip to content

Commit

Permalink
feat: update Jing (schema processor) to v20181222
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeltour committed Feb 25, 2019
1 parent 17f5eee commit cfca41b
Show file tree
Hide file tree
Showing 12 changed files with 234 additions and 248 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.daisy.libs</groupId>
<groupId>org.relaxng</groupId>
<artifactId>jing</artifactId>
<version>20120724.0.0</version>
<version>20181222</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void startElement(String uri, String localName, String qName,

for (int i = 0; i < attributes.getLength(); i++)
{
String attrName = attributes.getLocalName(i).toLowerCase(Locale.ROOT);
String attrName = attributes.getQName(i).toLowerCase(Locale.ROOT);
if (scriptEvents.contains(attrName))
{
this.inlineScriptCount++;
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/com/adobe/epubcheck/xml/XMLValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,20 +196,6 @@ public void initTransformerFactory(TransformerFactory factory)
{
configuration.registerExtensionFunction(new SystemIdFunction());
}
// Used to silence Saxon's warning about an XPath expression in Jing's built-in Schematron XSLT
// See issue #859
factory.setAttribute(FeatureKeys.XSLT_STATIC_ERROR_LISTENER_CLASS, SilencingErrorListener.class.getName());
}
}
}

public static class SilencingErrorListener extends StandardErrorListener {

@Override
public void warning(TransformerException exception) {
XPathException xe = XPathException.makeXPathException(exception);
if (!"SXWN9000".equals(xe.getErrorCodeLocalPart())) {
super.warning(exception);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,113 @@
{
"messages" : [ {
"ID" : "HTM-004",
"severity" : "ERROR",
"message" : "Irregular DOCTYPE: found '', expected '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \n\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">'.",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "HTM-010",
"severity" : "USAGE",
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file: attribute \"properties\" not allowed here; expected attribute \"fallback\", \"fallback-style\", \"href\", \"media-type\", \"required-modules\" or \"required-namespace\"",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/content.opf",
"line" : 12,
"column" : 90,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file: attribute \"property\" not allowed here; expected attribute \"content\", \"id\", \"name\", \"scheme\" or \"xml:lang\"",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/content.opf",
"line" : 7,
"column" : 39,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file: element \"body\" incomplete; expected element \"address\", \"blockquote\", \"del\", \"div\", \"dl\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"hr\", \"ins\", \"noscript\", \"ns:svg\", \"ol\", \"p\", \"pre\", \"script\", \"table\" or \"ul\" (with xmlns:ns=\"http://www.w3.org/2000/svg\")",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/toc.xhtml",
"line" : 14,
"column" : 8,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file: element \"meta\" missing required attributes \"content\" and \"name\"",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/content.opf",
"line" : 7,
"column" : 39,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file: element \"nav\" not allowed anywhere; expected element \"address\", \"blockquote\", \"del\", \"div\", \"dl\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"hr\", \"ins\", \"noscript\", \"ns:svg\", \"ol\", \"p\", \"pre\", \"script\", \"table\" or \"ul\" (with xmlns:ns=\"http://www.w3.org/2000/svg\")",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/toc.xhtml",
"line" : 9,
"column" : 22,
"context" : null
}, {
"path" : "OPS/toc.xhtml",
"line" : 12,
"column" : 10,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file: text not allowed here; expected the element end-tag",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/content.opf",
"line" : 7,
"column" : 59,
"context" : null
} ],
"suggestion" : null
} ],
"customMessageFileName" : null,
"checker" : {
"path" : "./com/adobe/epubcheck/test/opf/Epub3_marked_v2.epub",
"path" : "./test-classes/com/adobe/epubcheck/test/opf/Epub3_marked_v2.epub",
"filename" : "Epub3_marked_v2.epub",
"checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
"checkDate" : "09-05-2014 03:15:42",
"elapsedTime" : 57,
"checkerVersion" : "4.2.0-beta-SNAPSHOT",
"checkDate" : "02-24-2019 01:28:40",
"elapsedTime" : 35,
"nFatal" : 0,
"nError" : 7,
"nWarning" : 0,
Expand Down Expand Up @@ -171,107 +273,5 @@
"renditionOrientation" : null,
"renditionSpread" : null,
"referencedItems" : [ "OPS/page01.xhtml" ]
} ],
"messages" : [ {
"ID" : "HTM-004",
"severity" : "ERROR",
"message" : "Irregular DOCTYPE: found '', expected '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \n\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">'.",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "HTM-010",
"severity" : "USAGE",
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file: attribute \"properties\" not allowed here; expected attribute \"fallback\", \"fallback-style\", \"href\", \"media-type\", \"required-modules\" or \"required-namespace\"",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/content.opf",
"line" : 12,
"column" : 90,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file: attribute \"property\" not allowed here; expected attribute \"content\", \"id\", \"name\", \"scheme\" or \"xml:lang\"",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/content.opf",
"line" : 7,
"column" : 39,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file: element \"body\" incomplete; expected element \"address\", \"blockquote\", \"del\", \"div\", \"dl\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"hr\", \"ins\", \"noscript\", \"ns:svg\", \"ol\", \"p\", \"pre\", \"script\", \"table\" or \"ul\" (with xmlns:ns=\"http://www.w3.org/2000/svg\")",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/toc.xhtml",
"line" : 14,
"column" : 8,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file: element \"meta\" missing required attributes \"content\" and \"name\"",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/content.opf",
"line" : 7,
"column" : 39,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file: element \"nav\" not allowed anywhere; expected element \"address\", \"blockquote\", \"del\", \"div\", \"dl\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"hr\", \"ins\", \"noscript\", \"ns:svg\", \"ol\", \"p\", \"pre\", \"script\", \"table\" or \"ul\" (with xmlns:ns=\"http://www.w3.org/2000/svg\")",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/toc.xhtml",
"line" : 9,
"column" : 22,
"context" : null
}, {
"path" : "OPS/toc.xhtml",
"line" : 12,
"column" : 10,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file: text not allowed here; expected the element end-tag",
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/content.opf",
"line" : 7,
"column" : 61,
"context" : null
} ],
"suggestion" : null
} ]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/impl.xhtml",
"line" : 52,
"column" : 12,
"line" : 39,
"column" : 48,
"context" : "new XMLHttpRequest();"
} ],
"suggestion" : null
Expand All @@ -130,8 +130,8 @@
"path" : "./test-classes/com/adobe/epubcheck/test/opf/Media-type_handler.epub",
"filename" : "Media-type_handler.epub",
"checkerVersion" : "4.2.0-beta-SNAPSHOT",
"checkDate" : "02-05-2019 22:24:45",
"elapsedTime" : 368,
"checkDate" : "02-24-2019 01:28:43",
"elapsedTime" : 122,
"nFatal" : 0,
"nError" : 5,
"nWarning" : 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
"additionalLocations" : 0,
"locations" : [ {
"path" : "OPS/script_tag.xhtml",
"line" : 9,
"column" : 24,
"line" : 8,
"column" : 70,
"context" : "innerHTML = \"\";"
} ],
"suggestion" : "Use a DOM instead."
Expand Down Expand Up @@ -147,11 +147,11 @@
} ],
"customMessageFileName" : null,
"checker" : {
"path" : "./com/adobe/epubcheck/test/scripts/XMLHttpRequest.epub",
"path" : "./target/test-classes/com/adobe/epubcheck/test/scripts/XMLHttpRequest.epub",
"filename" : "XMLHttpRequest.epub",
"checkerVersion" : "4.2.0-beta-SNAPSHOT",
"checkDate" : "02-05-2019 15:38:31",
"elapsedTime" : 45,
"checkDate" : "02-24-2019 02:17:07",
"elapsedTime" : 104,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 0,
Expand Down
Loading

0 comments on commit cfca41b

Please sign in to comment.