embedContentDom = embeddedDoc.getContentDom();
header = (TextHElement) xpath.evaluate("//text:h[1]", embedContentDom, XPathConstants.NODE);
Assert.assertTrue(header.getTextContent().contains(TEST_SPAN_TEXT));
header.setTextContent("");
String packagePath = embeddedDoc.getDocumentPath() + SLASH + OdfPackage.OdfFile.IMAGE_DIRECTORY.getPath() + SLASH + TEST_PIC;
OdfFileEntry imageEntry = embeddedDoc.getPackage().getFileEntry(packagePath);
Assert.assertNotNull(imageEntry);
embeddedDoc.newImage(ResourceUtilities.getURI(TEST_PIC_ANOTHER));
//save the "DocA" as the standalone document
embeddedDoc.save(TEST_FILE_FOLDER + TEST_FILE_MODIFIED_EMBEDDED_SAVE_STANDALONE);
//load the standalone document and check the content
OdfDocument standaloneDoc = OdfDocument.loadDocument(ResourceUtilities.getAbsolutePath(TEST_FILE_MODIFIED_EMBEDDED_SAVE_STANDALONE));
embedContentDom = standaloneDoc.getContentDom();
header = (TextHElement) xpath.evaluate("//text:h[1]", embedContentDom, XPathConstants.NODE);
Assert.assertTrue(header.getTextContent().length() == 0);
imageEntry = standaloneDoc.getPackage().getFileEntry(OdfPackage.OdfFile.IMAGE_DIRECTORY.getPath() + SLASH + TEST_PIC);
Assert.assertNotNull(imageEntry);
OdfFileEntry anotherImageEntry = standaloneDoc.getPackage().getFileEntry(OdfPackage.OdfFile.IMAGE_DIRECTORY.getPath() + SLASH + TEST_PIC_ANOTHER);
Assert.assertNotNull(anotherImageEntry);
} catch (Exception ex) {
LOG.log(Level.SEVERE, null, ex);
Assert.fail("Failed with " + ex.getClass().getName() + ": '" + ex.getMessage() + "'");
}