The OpenDoPE approach to document automation

OpenDoPE is a set of conventions for doing document assembly using Open XML (the ISO-standard Microsoft Word docx file format), specifically, its content control databinding architecture.

What is a content control?

A content control is a container for content. It is a standard feature of the docx file format.

It provides a natural, modern way to insert text, for example

   Dear Click here to enter text.

A rich text content control can contain paragraphs and tables, or just a run of text.

The OpenXML element for a content control is <w:sdt>.

What is content control data binding?

A user can include an arbitrary XML document in their docx file - such an XML file is called a custom xml part.

A content control can be bound to an element in the custom xml file, via an XPath expression. This is done with a <w:databinding>:

<w:sdt>

<w:sdtPr>

<w:dataBinding w:xpath="/invoice[1]/customer[1]/name[1]"/>

What does OpenDoPE add?

So Open XML provides an elegant way of inserting data (variable replacement/basic mail merge).

What it does not do though, is provide any guidance as to how to implement:

conditional inclusion/exclusion of paragraphs or other units of content

repeat (eg of list items, table rows, or other units of content)

inclusion/insertion of other documents (content reuse)

OpenDoPE is:

a Convention for representing the above features using content controls and Custom XML parts

reference software implementing the Convention