Class ContentControlBindingExtensions

java.lang.Object
org.docx4j.samples.ContentControlBindingExtensions

public class ContentControlBindingExtensions extends Object
This sample demonstrates populating content controls from a custom xml part (based on the xpaths given in the content controls), via FLAG_BIND_BIND_XML Word does this itself automatically, for if there is a w:databinding element in the sdtPr. However, out of the box, Word doesn't allow for repeating things (table rows, paragraphs etc), nor conditional inclusion/exclusion. The OpenDoPE conventions support that; and this sample demonstrates docx4j's implementation of that. In practice you'll want the XML part to be injected at runtime. For that, use FLAG_NONE, or include FLAG_BIND_INSERT_XML. See description of flags below.
  • Field Details

    • context

      public static jakarta.xml.bind.JAXBContext context
    • filepathprefix

      static String filepathprefix
  • Constructor Details

    • ContentControlBindingExtensions

      public ContentControlBindingExtensions()
  • Method Details