* @return
*/
private Document createHTMLDocument(Document cruxPageDocument)
{
Document htmlDocument;
DocumentType doctype = cruxPageDocument.getDoctype();
if (doctype != null || Boolean.parseBoolean(ConfigurationFactory.getConfigurations().enableGenerateHTMLDoctype()))
{
String name = doctype != null ? doctype.getName() : "HTML";
String publicId = doctype != null ? doctype.getPublicId() : null;
String systemId = doctype != null ? doctype.getSystemId() : null;
DocumentType newDoctype = documentBuilder.getDOMImplementation().createDocumentType(name, publicId, systemId);
htmlDocument = documentBuilder.getDOMImplementation().createDocument(XHTML_NAMESPACE, "html", newDoctype);
}
else
{
htmlDocument = documentBuilder.newDocument();