Class OpenDoPEHandler

java.lang.Object
org.docx4j.model.datastorage.OpenDoPEHandler

public class OpenDoPEHandler extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • getDomToXPathMap

      public DomToXPathMap getDomToXPathMap()
    • getNextBookmarkId

      public AtomicInteger getNextBookmarkId()
      Provide a way to for user to fetch the starting bookmark ID number for use in the next stage (ie Binding Traverse). If it isn't fetched/set, the value will have to be recalculated (less efficient).
      Since:
      3.2.1
    • preprocess

      public WordprocessingMLPackage preprocess() throws Docx4JException
      Preprocess content controls which have tag "od:condition|od:repeat|od:component". It is "preprocess" in the sense that it is "pre" opening in Word The algorithm is as follows: Inject components first. Look at each top level SDT (ShallowTraversor). If it does not have a real data binding, it might have a bindingrole tag we need to process (processBindingRoleIfAny). Conditionals are easy. processRepeat method: - clones the sdt n times - invokes DeepTraversor which changes xpath binding on descendant sdts (both sdts with real bindings and sdts with bindingrole tags). It is not the job of DeepTraversor to expand out any other repeats it might encounter, or to resolve conditionals. Those things are done by ShallowTraversor, to which control returns, as it continues its traverse. The implementation of 13 Sept 2010 replaced the previous XPath based implementation, which did not support nested repeats. I've chosen to build this around TraversalUtil, instead of using XSLT, and this seems to have worked out nicely. The implementation of 10 October 2010 replaced the v1 conventions implementation with a v2 implementation. The main method in this class can convert v1 documents to v2. The v2 implementation is not yet complete. All v1 features are implemented, but not the new v2 stuff (eg complex conditions).
      Parameters:
      documentPart -
      Throws:
      Exception
      Docx4JException
    • getParts

      protected static Set<ContentAccessor> getParts(WordprocessingMLPackage srcPackage)
    • getRepeatXpathBase

      protected static String getRepeatXpathBase(String xpath)
      Massage the xpath into an expected format, by dropping any trailing '/' or [1]
      Parameters:
      xpath -
      Returns:
    • getSdtPr

      public static SdtPr getSdtPr(Object o)