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

Free Support Forum - aspose.com

Aspose Word Java can convert html to wordML 2003

Please help me!
Aspose Word Java can convert html to wordML 2003
Ex:
xml = ConvertHtmlToWordML(html);

input: String html =“Have a Great Day Ahead


output: String xml ="
<w:p>
<w:r>
<w:rPr>
<w:u w:val=“single”/>
<w:i/>
<w:b/>
</w:rPr>

<w:t>Have a Great Day Ahead</w:t>
</w:r>
</w:p>"

Hi

Thanks for your request. There is no direct way to achieve what you need. However, you can insert your HTML string into an empty document and then save this document as Word 2003 XML. After this you will be able to extract WML string from this document.

Please follow the following link to learn more about InsertHtml method:

http://www.aspose.com/documentation/java-components/aspose.words-for-java/com/aspose/words/documentbuilder.html#insertHtml(java.lang.String)

Here you can find a simple code example how you can save a document:

http://www.aspose.com/documentation/java-components/aspose.words-for-java/com/aspose/words/document.html#save(java.io.OutputStream, com.aspose.words.SaveOptions)

If you save the document to stream you will be able to do all actions in memory without saving the output document to disk.

Best regards,