WordML to Docx

Hi,

I need convert WordML(.xml) file into Docx file. So, Please Help me how to archive this.

Regards,
Srinadh.

Im not sure on Aspose.Words capabilities on this, but you should be able to do it pretty easily with the OpenXML SDK. You create a new OpenXML document, then load the content of your WordML XML file into the main document part (in the OpenXML document). You then can save the OpenXML document as a .DOCX file.
Though thats for C#, and i’ve just noticed you’re talking from a Java perspective - but a read of this may point you in the right direction;

Hi Srinadh,

Thanks for your query. You can convert WordML to Docx by using following code snippet.

Document doc = new Document(MyDir + "in.xml");
doc.Save(MyDir + "AsposeOut.docx");

Please read following documentation links for your kind reference and let us know if you have any more queries.

https://reference.aspose.com/words/net/aspose.words/saveformat/
https://reference.aspose.com/words/net/aspose.words/loadformat

Thanks for the replay!!.

But, i want active this Conversion from WordML to Docx using JAVA language.

Regards
Srinadh.

Hi Srinadh,

Please accept my apologies for late response.

Please use the following Java code snippet to convert WordML file to Docx file format.

doc = new Document("in.xml");
doc.save("AsposeOut.docx"); 

Please read the following documentation links for your kind reference and let us know if still face any problem.

http://www.aspose.com/docs/display/wordsjava/LoadFormat
http://www.aspose.com/docs/display/wordsjava/SaveFormat

Thanks for reply.

I tried with sample code, but, when i run the code in Eclipse,I am getting on window as Bsh console. please help me what is that and how to avoid the console.

Rectify the code if Is any thing wrong in java code.

i attached the Docx.zip, it’s contains java file(AsposeDocx.java) , sample input file(wordml.xml) and getting console snapshot image.

Regards
Srinadh

Hi Srinadh,

Thanks for sharing the documents. I have worked with your document and have not faced any issue while using latest version of Aspose.Words for Java. There is no issue with your code. Please use the latest version of Aspose.Words for Java.

Please find the output document in attachment and let us know if you have any more queries.