HtmlSaveOptions.ExportXhtmlTransitional
HtmlSaveOptions.ExportXhtmlTransitional property
Specifies whether to write the DOCTYPE declaration when saving to HTML or MHTML. When true
, writes a DOCTYPE declaration in the document prior to the root element. Default value is false
. When saving to EPUB or HTML5 (Html5) the DOCTYPE declaration is always written.
public bool ExportXhtmlTransitional { get; set; }
Remarks
Wordize always writes well formed HTML regardless of this setting.
When true
, the beginning of the HTML output document will look like this:
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Wordize aims to output XHTML according to the XHTML 1.0 Transitional specification, 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.
Examples
Shows how to specify version of HTML.
HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions();
htmlSaveOptions.HtmlVersion = HtmlVersion.Xhtml;
htmlSaveOptions.ExportXhtmlTransitional = true;
Converter.Create()
.From(MyDir + "Simple.docx")
.To(ArtifactsDir + "HtmlSaveOptions.ExportXhtmlTransitional.html", htmlSaveOptions)
.Execute();
See Also
- class HtmlSaveOptions
- namespace Wordize.Saving
- assembly Wordize