We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Saving in xhtml

According to the following extract, aspose words support xhtml. But in the save options do not include xhtml.
1-How can I save a document in xhtml
2-What is the suggested mechanism for converting an html document to xhtml?
thank you
Load and save HTML/XHTML/MHTML for greater interoperability.
Aspose.Words HTML and XHTML import is resilient to documents that are not
well formed or that are invalid. Invalid or unrecognized elements or
attributes are safely ignored during import. Conversion to HTML and
XHTML in Aspose.Words is customizable, many parameters like the export
of document properties, headers and footers, image locations, scaling and
resolution, form field export options and others can all be specified.


Thanks for your inquiry. You can save your HTML document to XHTML format by using the following code snippet:

LoadOptions options = new LoadOptions();
options.LoadFormat = LoadFormat.Html;
Document doc = new Document(@"C:\test\In.html", options);

Moreover, currently Aspose.Words does not provide any class e.g. XHtmlSaveOptions to be able to explicitly specify additional options when saving a document into the xHTML format.

Please let us know if you need more information, We are always glad to help you.

Best Regards,

Thanks for your inquiry. In your case, you should specify this option:
Best regards,