Skip to content

Commit cfca41b

Browse files
committed
feat: update Jing (schema processor) to v20181222
1 parent 17f5eee commit cfca41b

12 files changed

+234
-248
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@
180180
</exclusions>
181181
</dependency>
182182
<dependency>
183-
<groupId>org.daisy.libs</groupId>
183+
<groupId>org.relaxng</groupId>
184184
<artifactId>jing</artifactId>
185-
<version>20120724.0.0</version>
185+
<version>20181222</version>
186186
<exclusions>
187187
<exclusion>
188188
<groupId>xml-apis</groupId>

src/main/java/com/adobe/epubcheck/ctc/xml/ScriptTagHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public void startElement(String uri, String localName, String qName,
118118

119119
for (int i = 0; i < attributes.getLength(); i++)
120120
{
121-
String attrName = attributes.getLocalName(i).toLowerCase(Locale.ROOT);
121+
String attrName = attributes.getQName(i).toLowerCase(Locale.ROOT);
122122
if (scriptEvents.contains(attrName))
123123
{
124124
this.inlineScriptCount++;

src/main/java/com/adobe/epubcheck/xml/XMLValidator.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,20 +196,6 @@ public void initTransformerFactory(TransformerFactory factory)
196196
{
197197
configuration.registerExtensionFunction(new SystemIdFunction());
198198
}
199-
// Used to silence Saxon's warning about an XPath expression in Jing's built-in Schematron XSLT
200-
// See issue #859
201-
factory.setAttribute(FeatureKeys.XSLT_STATIC_ERROR_LISTENER_CLASS, SilencingErrorListener.class.getName());
202-
}
203-
}
204-
}
205-
206-
public static class SilencingErrorListener extends StandardErrorListener {
207-
208-
@Override
209-
public void warning(TransformerException exception) {
210-
XPathException xe = XPathException.makeXPathException(exception);
211-
if (!"SXWN9000".equals(xe.getErrorCodeLocalPart())) {
212-
super.warning(exception);
213199
}
214200
}
215201
}

src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2_expected_results.json

Lines changed: 107 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,113 @@
11
{
2+
"messages" : [ {
3+
"ID" : "HTM-004",
4+
"severity" : "ERROR",
5+
"message" : "Irregular DOCTYPE: found '', expected '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \n\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">'.",
6+
"additionalLocations" : 0,
7+
"locations" : [ {
8+
"path" : "OPS/toc.xhtml",
9+
"line" : -1,
10+
"column" : -1,
11+
"context" : null
12+
} ],
13+
"suggestion" : null
14+
}, {
15+
"ID" : "HTM-010",
16+
"severity" : "USAGE",
17+
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
18+
"additionalLocations" : 0,
19+
"locations" : [ {
20+
"path" : "OPS/toc.ncx",
21+
"line" : 2,
22+
"column" : 68,
23+
"context" : ""
24+
} ],
25+
"suggestion" : null
26+
}, {
27+
"ID" : "RSC-005",
28+
"severity" : "ERROR",
29+
"message" : "Error while parsing file: attribute \"properties\" not allowed here; expected attribute \"fallback\", \"fallback-style\", \"href\", \"media-type\", \"required-modules\" or \"required-namespace\"",
30+
"additionalLocations" : 0,
31+
"locations" : [ {
32+
"path" : "OPS/content.opf",
33+
"line" : 12,
34+
"column" : 90,
35+
"context" : null
36+
} ],
37+
"suggestion" : null
38+
}, {
39+
"ID" : "RSC-005",
40+
"severity" : "ERROR",
41+
"message" : "Error while parsing file: attribute \"property\" not allowed here; expected attribute \"content\", \"id\", \"name\", \"scheme\" or \"xml:lang\"",
42+
"additionalLocations" : 0,
43+
"locations" : [ {
44+
"path" : "OPS/content.opf",
45+
"line" : 7,
46+
"column" : 39,
47+
"context" : null
48+
} ],
49+
"suggestion" : null
50+
}, {
51+
"ID" : "RSC-005",
52+
"severity" : "ERROR",
53+
"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\")",
54+
"additionalLocations" : 0,
55+
"locations" : [ {
56+
"path" : "OPS/toc.xhtml",
57+
"line" : 14,
58+
"column" : 8,
59+
"context" : null
60+
} ],
61+
"suggestion" : null
62+
}, {
63+
"ID" : "RSC-005",
64+
"severity" : "ERROR",
65+
"message" : "Error while parsing file: element \"meta\" missing required attributes \"content\" and \"name\"",
66+
"additionalLocations" : 0,
67+
"locations" : [ {
68+
"path" : "OPS/content.opf",
69+
"line" : 7,
70+
"column" : 39,
71+
"context" : null
72+
} ],
73+
"suggestion" : null
74+
}, {
75+
"ID" : "RSC-005",
76+
"severity" : "ERROR",
77+
"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\")",
78+
"additionalLocations" : 0,
79+
"locations" : [ {
80+
"path" : "OPS/toc.xhtml",
81+
"line" : 9,
82+
"column" : 22,
83+
"context" : null
84+
}, {
85+
"path" : "OPS/toc.xhtml",
86+
"line" : 12,
87+
"column" : 10,
88+
"context" : null
89+
} ],
90+
"suggestion" : null
91+
}, {
92+
"ID" : "RSC-005",
93+
"severity" : "ERROR",
94+
"message" : "Error while parsing file: text not allowed here; expected the element end-tag",
95+
"additionalLocations" : 0,
96+
"locations" : [ {
97+
"path" : "OPS/content.opf",
98+
"line" : 7,
99+
"column" : 59,
100+
"context" : null
101+
} ],
102+
"suggestion" : null
103+
} ],
2104
"customMessageFileName" : null,
3105
"checker" : {
4-
"path" : "./com/adobe/epubcheck/test/opf/Epub3_marked_v2.epub",
106+
"path" : "./test-classes/com/adobe/epubcheck/test/opf/Epub3_marked_v2.epub",
5107
"filename" : "Epub3_marked_v2.epub",
6-
"checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
7-
"checkDate" : "09-05-2014 03:15:42",
8-
"elapsedTime" : 57,
108+
"checkerVersion" : "4.2.0-beta-SNAPSHOT",
109+
"checkDate" : "02-24-2019 01:28:40",
110+
"elapsedTime" : 35,
9111
"nFatal" : 0,
10112
"nError" : 7,
11113
"nWarning" : 0,
@@ -171,107 +273,5 @@
171273
"renditionOrientation" : null,
172274
"renditionSpread" : null,
173275
"referencedItems" : [ "OPS/page01.xhtml" ]
174-
} ],
175-
"messages" : [ {
176-
"ID" : "HTM-004",
177-
"severity" : "ERROR",
178-
"message" : "Irregular DOCTYPE: found '', expected '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \n\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">'.",
179-
"additionalLocations" : 0,
180-
"locations" : [ {
181-
"path" : "OPS/toc.xhtml",
182-
"line" : -1,
183-
"column" : -1,
184-
"context" : null
185-
} ],
186-
"suggestion" : null
187-
}, {
188-
"ID" : "HTM-010",
189-
"severity" : "USAGE",
190-
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
191-
"additionalLocations" : 0,
192-
"locations" : [ {
193-
"path" : "OPS/toc.ncx",
194-
"line" : 2,
195-
"column" : 68,
196-
"context" : ""
197-
} ],
198-
"suggestion" : null
199-
}, {
200-
"ID" : "RSC-005",
201-
"severity" : "ERROR",
202-
"message" : "Error while parsing file: attribute \"properties\" not allowed here; expected attribute \"fallback\", \"fallback-style\", \"href\", \"media-type\", \"required-modules\" or \"required-namespace\"",
203-
"additionalLocations" : 0,
204-
"locations" : [ {
205-
"path" : "OPS/content.opf",
206-
"line" : 12,
207-
"column" : 90,
208-
"context" : null
209-
} ],
210-
"suggestion" : null
211-
}, {
212-
"ID" : "RSC-005",
213-
"severity" : "ERROR",
214-
"message" : "Error while parsing file: attribute \"property\" not allowed here; expected attribute \"content\", \"id\", \"name\", \"scheme\" or \"xml:lang\"",
215-
"additionalLocations" : 0,
216-
"locations" : [ {
217-
"path" : "OPS/content.opf",
218-
"line" : 7,
219-
"column" : 39,
220-
"context" : null
221-
} ],
222-
"suggestion" : null
223-
}, {
224-
"ID" : "RSC-005",
225-
"severity" : "ERROR",
226-
"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\")",
227-
"additionalLocations" : 0,
228-
"locations" : [ {
229-
"path" : "OPS/toc.xhtml",
230-
"line" : 14,
231-
"column" : 8,
232-
"context" : null
233-
} ],
234-
"suggestion" : null
235-
}, {
236-
"ID" : "RSC-005",
237-
"severity" : "ERROR",
238-
"message" : "Error while parsing file: element \"meta\" missing required attributes \"content\" and \"name\"",
239-
"additionalLocations" : 0,
240-
"locations" : [ {
241-
"path" : "OPS/content.opf",
242-
"line" : 7,
243-
"column" : 39,
244-
"context" : null
245-
} ],
246-
"suggestion" : null
247-
}, {
248-
"ID" : "RSC-005",
249-
"severity" : "ERROR",
250-
"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\")",
251-
"additionalLocations" : 0,
252-
"locations" : [ {
253-
"path" : "OPS/toc.xhtml",
254-
"line" : 9,
255-
"column" : 22,
256-
"context" : null
257-
}, {
258-
"path" : "OPS/toc.xhtml",
259-
"line" : 12,
260-
"column" : 10,
261-
"context" : null
262-
} ],
263-
"suggestion" : null
264-
}, {
265-
"ID" : "RSC-005",
266-
"severity" : "ERROR",
267-
"message" : "Error while parsing file: text not allowed here; expected the element end-tag",
268-
"additionalLocations" : 0,
269-
"locations" : [ {
270-
"path" : "OPS/content.opf",
271-
"line" : 7,
272-
"column" : 61,
273-
"context" : null
274-
} ],
275-
"suggestion" : null
276276
} ]
277-
}
277+
}

src/test/resources/com/adobe/epubcheck/test/opf/Media-type_handler_expected_results.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102
"additionalLocations" : 0,
103103
"locations" : [ {
104104
"path" : "OPS/impl.xhtml",
105-
"line" : 52,
106-
"column" : 12,
105+
"line" : 39,
106+
"column" : 48,
107107
"context" : "new XMLHttpRequest();"
108108
} ],
109109
"suggestion" : null
@@ -130,8 +130,8 @@
130130
"path" : "./test-classes/com/adobe/epubcheck/test/opf/Media-type_handler.epub",
131131
"filename" : "Media-type_handler.epub",
132132
"checkerVersion" : "4.2.0-beta-SNAPSHOT",
133-
"checkDate" : "02-05-2019 22:24:45",
134-
"elapsedTime" : 368,
133+
"checkDate" : "02-24-2019 01:28:43",
134+
"elapsedTime" : 122,
135135
"nFatal" : 0,
136136
"nError" : 5,
137137
"nWarning" : 1,

src/test/resources/com/adobe/epubcheck/test/scripts/XMLHttpRequest_expected_results.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@
8888
"additionalLocations" : 0,
8989
"locations" : [ {
9090
"path" : "OPS/script_tag.xhtml",
91-
"line" : 9,
92-
"column" : 24,
91+
"line" : 8,
92+
"column" : 70,
9393
"context" : "innerHTML = \"\";"
9494
} ],
9595
"suggestion" : "Use a DOM instead."
@@ -147,11 +147,11 @@
147147
} ],
148148
"customMessageFileName" : null,
149149
"checker" : {
150-
"path" : "./com/adobe/epubcheck/test/scripts/XMLHttpRequest.epub",
150+
"path" : "./target/test-classes/com/adobe/epubcheck/test/scripts/XMLHttpRequest.epub",
151151
"filename" : "XMLHttpRequest.epub",
152152
"checkerVersion" : "4.2.0-beta-SNAPSHOT",
153-
"checkDate" : "02-05-2019 15:38:31",
154-
"elapsedTime" : 45,
153+
"checkDate" : "02-24-2019 02:17:07",
154+
"elapsedTime" : 104,
155155
"nFatal" : 0,
156156
"nError" : 0,
157157
"nWarning" : 0,

0 commit comments

Comments
 (0)