Namespaces.CUSTOM_XML_DATA_STORAGE_PROPERTIES);
if (r==null) {
log.debug(".. but that doesn't point to a customXmlProps part");
continue;
}
CustomXmlDataStoragePropertiesPart customXmlProps =
(CustomXmlDataStoragePropertiesPart)entry.getRelationshipsPart().getPart(r);
if (customXmlProps==null) {
log.error(".. but the target seems to be missing?");
if (entry instanceof CustomXmlDataStoragePart) {
try {
org.w3c.dom.Document document = ((CustomXmlDataStoragePart)entry).getData().getDocument();
String localName = document.getDocumentElement().getLocalName();
log.debug(localName);
if (document.getDocumentElement().isDefaultNamespace("http://schemas.microsoft.com/?office/?2006/?coverPageProps")
|| localName.equals("CoverPageProperties" ) ) {
// Special case: CoverPageProperties
// See "Office Well Defined Custom XML Parts"; see documentinteropinitiative.org/additionalinfo/IS29500/sect5.aspx
// Has a rels part, but sometimes no target? Sometimes it definitely does ...
// Give it the store item id, Word 2007 seems to consistently allocate
itemId = BindingHandler.COVERPAGE_PROPERTIES_STOREITEMID.toLowerCase();
} else {
continue;
}
} catch (Docx4JException e) {
e.printStackTrace();
continue;
}
}
} else {
itemId = customXmlProps.getItemId().toLowerCase();
}
}
log.info("Identified/registered ds:itemId " + itemId);
if (pkg.getCustomXmlDataStorageParts().get(itemId.toLowerCase())!=null) {
log.warn("Duplicate CustomXML itemId " + itemId + "; check your source docx!");