Class VariableReplaceSAX

java.lang.Object
org.docx4j.samples.VariableReplaceSAX

public class VariableReplaceSAX extends Object
This is an example of using SAX rather than JAXB for processing. There's another example which uses StAX. Unless you have a particular reason for wanting to use SAX, you should probably be using StAX. NB: There are at least 3 approaches for replacing variables in a docx. 1. as shows in this example 2. using Merge Fields (see org.docx4j.model.fields.merge.MailMerger) 3. binding content controls to an XML Part (via XPath) and this is not the recommended approach! It is just a good example of using SAX.
  • Field Details

  • Constructor Details

    • VariableReplaceSAX

      public VariableReplaceSAX()
  • Method Details