Page 1 of 1

working with MS Office 2003 xml

PostPosted: Tue Dec 02, 2008 6:55 am
by codified44
Hi

i would like to work completely in MS Word 2003 schema. Does docx4j support MS Word 2003 xml/schema? If that is not possible, i can operate on MS Word 2007 xml/schema. But i need to be able to save in MS Word 2003 format (xml or doc). So, is there a way i can save to or convert to an MS Word 2003 format (xml or doc) file using docx4j or any other means?

Thanks in advance!!

Re: working with MS Office 2003 xml

PostPosted: Tue Dec 02, 2008 7:20 am
by jason
Hi,

The classes in org.docx4j.wml are generated from modified copies of the ECMA 376 schemas (ie Word 2007).

There are some minor differences between the 2007 and 2003 schemas, which will affect your application if your docs use those features.

Off the top of my head, the main thing you need to do to use docx4j to save in Word 2003 xml is to write the document out using Word 2003 namespace declarations.

We don't have a method to do that at the moment.

You'll see that SaveToZipFile basically saves the result of calling, for each part, marshal(java.io.OutputStream os) in JaxbXmlPart (those class names are hyperlinks...).

So you need to intercept that and translate the namespaces. Should be pretty straightforward to try out.

An alternative would be to modify the schemas (which are in svn) so that they match Word 2003, and then regenerate the classes so you use Word 2003 XML from end to end. This would be more fiddlely, and wouldn't interoperate with Word 2007.

Good luck!

Re: working with MS Office 2003 xml

PostPosted: Thu May 23, 2013 2:39 pm
by jason
For what it is worth, https://github.com/plutext/docx4j/commi ... 18c748ebaf is a bare bones proof of concept of importing Word 2003 XML.