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

Free Support Forum - aspose.com

Saving in xhtml

Hi,

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

http://www.aspose.com/categories/.net-components/aspose.words-for-.net/why-choose.aspx

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.

Hi,


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

LoadOptions options = new LoadOptions();<o:p></o:p>

options.LoadFormat = LoadFormat.Html;

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

doc.Save(@"C:\test\out.xhtml");


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,

Hi

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

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.saving.htmlsaveoptions.exportxhtmltransitional.html

Best regards,