Developer Documentation
Architecture
The library is divided into 2 basic packages:
* openpackaging, which converts a docx Package and its constituent Parts to/from Java objects, and has a suitable class for each Part;
* org.docx4j.wml, which represents the XML in the document.xml Part as Java objects using JAXB (there are other packages for document properties and the theme part (dml) );
Development environment
You can download a pre-built jar, and use that in your project.
On this page though, "developer" really means people who want to (or need to) work on the docx4j source code.
For that, you'll need to set up a development environment from scratch, or use the virtual appliance (once its updated for v2.0).
JAXB
docx4j uses JAXB to marshall and unmarshall the key parts in a WordprocessingML document, including the main document part, the styles part, the theme part, and the properties parts.
We use JAXB's XJC to generate org.docx4j.wml, org.docx4j.dml, org.docx4j.docProps and org.docx4j.customxml
We have modified the wml.xsd schema in particular, so that the key resulting classes are a bit more human friendly (ie don't all start with CT_ and ST_). The schemas we are using can be found here. Note that ECMA made them available free of copyright, so we are able to modify them.
You shouldn't need to re-generate the classes from the schema, but rough notes on doing so are at Xjc etc.