Examples of SdtRun


Examples of org.docx4j.wml.SdtRun

      addPartEntries(key);
      keys.put(key,  key);
    }
   
    // create the content control
    SdtRun sdtRun = Context.getWmlObjectFactory().createSdtRun();
    replacementContent.add(sdtRun);

    SdtPr sdtPr = Context.getWmlObjectFactory().createSdtPr();
    sdtRun.setSdtPr(sdtPr);
    /* <w:sdtPr>
        <w:alias w:val="Title of document"/>
        <w:tag w:val="od:xpath=cktpD"/>
        <w:id w:val="289095091"/>
        <w:dataBinding w:prefixMappings="xmlns:oda='http://opendope.org/answers'"
        w:xpath="/oda:answers/oda:answer[@id='Title_of_document_nM']"
        w:storeItemID="{183E9AF4-65AB-46DF-8044-944891825721}"/>
        <w:text w:multiLine="1"/>
      </w:sdtPr>
      */
   
    Alias alias = Context.getWmlObjectFactory().createSdtPrAlias();
    alias.setVal(key);
    Tag tag = Context.getWmlObjectFactory().createTag();
    tag.setVal("od:xpath=" + key);
    sdtPr.setTag(tag);
    sdtPr.setId();
    CTDataBinding ctDataBinding = Context.getWmlObjectFactory().createCTDataBinding();
    JAXBElement<CTDataBinding> jaxbDB =
        Context.getWmlObjectFactory().createSdtPrDataBinding(ctDataBinding);
    sdtPr.setDataBinding(ctDataBinding);
    ctDataBinding.setXpath("/oda:answers/oda:answer[@id='" + key +"']");
    ctDataBinding.setPrefixMappings("xmlns:oda='http://opendope.org/answers'");
    ctDataBinding.setStoreItemID(storeItemID);
         
    CTSdtContentRun sdtContent = Context.getWmlObjectFactory().createCTSdtContentRun();     
    sdtRun.setSdtContent(sdtContent);

    R rnew = new R();
    rnew.setRPr( rPr ); // point at old rPr, if any
    Text text = Context.getWmlObjectFactory().createText();
    text.setValue(key);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.