|
@@ -75,14 +75,6 @@ public class ResourcesLoader {
|
|
|
} else {
|
|
} else {
|
|
|
resource = ResourceUtil
|
|
resource = ResourceUtil
|
|
|
.createResource(zipEntry.getName(), zipFileWrapper.getInputStream(zipEntry));
|
|
.createResource(zipEntry.getName(), zipFileWrapper.getInputStream(zipEntry));
|
|
|
- /*掌上书苑有很多自制书OPF的nameSpace格式不标准,强制修复成正确的格式*/
|
|
|
|
|
- if (href.endsWith("opf")) {
|
|
|
|
|
- String string = new String(resource.getData())
|
|
|
|
|
- .replace(" smlns=\"", " xmlns=\"")
|
|
|
|
|
- .replace(" mlns=\"", " xmlns=\"");
|
|
|
|
|
- resource.setData(string.getBytes());
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (resource.getMediaType() == MediaTypes.XHTML) {
|
|
if (resource.getMediaType() == MediaTypes.XHTML) {
|
|
@@ -134,17 +126,10 @@ public class ResourcesLoader {
|
|
|
if ((zipEntry == null) || zipEntry.isDirectory()) {
|
|
if ((zipEntry == null) || zipEntry.isDirectory()) {
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- String href = zipEntry.getName();
|
|
|
|
|
|
|
+ //String href = zipEntry.getName();
|
|
|
|
|
|
|
|
// store resource
|
|
// store resource
|
|
|
Resource resource = ResourceUtil.createResource(zipEntry.getName(), zipInputStream);
|
|
Resource resource = ResourceUtil.createResource(zipEntry.getName(), zipInputStream);
|
|
|
- ///*掌上书苑有很多自制书OPF的nameSpace格式不标准,强制修复成正确的格式*/
|
|
|
|
|
- if (href.endsWith("opf")) {
|
|
|
|
|
- String string = new String(resource.getData())
|
|
|
|
|
- .replace(" smlns=\"", " xmlns=\"")
|
|
|
|
|
- .replace(" mlns=\"", " xmlns=\"");
|
|
|
|
|
- resource.setData(string.getBytes());
|
|
|
|
|
- }
|
|
|
|
|
if (resource.getMediaType() == MediaTypes.XHTML) {
|
|
if (resource.getMediaType() == MediaTypes.XHTML) {
|
|
|
resource.setInputEncoding(defaultHtmlEncoding);
|
|
resource.setInputEncoding(defaultHtmlEncoding);
|
|
|
}
|
|
}
|