public class HtmlVersion
Example:
Document doc = new Document(getMyDir() + "Rendering.docx");
// Save the document to a .html file of the XHTML 1.0 Transitional standard
HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.HTML);
{
options.setHtmlVersion(com.aspose.words.HtmlVersion.XHTML);
options.setExportXhtmlTransitional(true);
options.setPrettyFormat(true);
}
// The DOCTYPE declaration at the top of this document will indicate the html version we chose
doc.save(getArtifactsDir() + "HtmlSaveOptions.HtmlVersion.html", options);
Field Summary | ||
---|---|---|
static final int | XHTML | |
Saves the document in compliance with the XHTML 1.0 Transitional standard.
|
||
static final int | HTML_5 | |
Saves the document in compliance with the HTML 5 standard.
|
public static final int XHTML
Aspose.Words aims to output XHTML according to the XHTML 1.0 Transitional standard, but the output will not always validate against the DTD. Some structures inside a Microsoft Word document are hard or impossible to map to a document that will validate against the XHTML schema. For example, XHTML does not allow nested lists (UL cannot be nested inside another UL element), but in Microsoft Word document multilevel lists occur quite often.
public static final int HTML_5