for (int i = 0; i < epubPackage.getManifest().itemsLength(); i++)
{
ManifestItem mi = epubPackage.getManifest().getItem(i);
if (vtsd.isValidMediaType(mi.getMediaType()))
{
XMLContentDocParser parser = new XMLContentDocParser(epubPackage.getZip(), report);
HTMLTagsAnalyseHandler sh = new HTMLTagsAnalyseHandler();
sh.setReport(report);
SpineItem si = spineItems.get(mi.getId());
boolean itemIsFixedFormat = isGlobalFixed;
if (si != null)
{
String properties = si.getProperties();
if (properties != null)
{
if (properties != null && !properties.equals(""))
{
properties = properties.replaceAll("[\\s]+", " ");
String propertyArray[] = properties.split(" ");
for (String prop : propertyArray)
{
if (prop.equals("rendition:layout-pre-paginated"))
{
itemIsFixedFormat = true;
}
else if (prop.equals("rendition:layout-reflowable"))
{
itemIsFixedFormat = false;
}
}
}
}
sh.setIsFixed(itemIsFixedFormat);
}
String fileToParse = epubPackage.getManifestItemFileName(mi);
ZipEntry entry = zip.getEntry(fileToParse);
if (entry == null)
{
String fileName = new File(zip.getName()).getName();
report.message(MessageId.RSC_001, new MessageLocation(fileName, -1, -1), fileToParse);
continue;
}
sh.setVersion(epubPackage.getVersion());
sh.setFileName(fileToParse);
//parser.parseDoc(fileToParse, sh);
/***VALIDATE FILE EXTENSION***/
String fileExtension = mi.getHref().substring(mi.getHref().lastIndexOf('.') + 1, mi.getHref().length());
if (epubPackage.getVersion() == EPUBVersion.VERSION_2
&& !(fileExtension.compareToIgnoreCase("html") == 0
|| fileExtension.compareToIgnoreCase("htm") == 0
|| fileExtension.compareToIgnoreCase("xhtml") == 0))
{
// Note: extension is already checked in OPFChecker30 for EPUB 3
report.message(MessageId.HTM_014, new MessageLocation(mi.getHref(), -1, -1));
}
/***VALIDATE DOCTYPE***/
int docTypeMatches = findMatchingDocumentTypePatterns(fileToParse);
if ((0 != (docTypeMatches & hasHTML4)) && (epubPackage.getVersion() == EPUBVersion.VERSION_3))
{
report.message(MessageId.HTM_015, new MessageLocation(mi.getHref(), -1, -1));
}
else if ((0 != (docTypeMatches & hasHTML5)) && ((hasXhtml != (docTypeMatches & hasXhtml))) && (epubPackage.getVersion() == EPUBVersion.VERSION_2))
{
report.message(MessageId.HTM_016, new MessageLocation(mi.getHref(), -1, -1));
}
parser.parseDoc(fileToParse, sh);
if (sh.getHtml5SpecTagsCounter() > 0)
{
report.info(fileToParse, FeatureEnum.HAS_HTML5, "true");
if (epubPackage.isSpineItem(mi.getId()))