Package org.docx4j

Examples of org.docx4j.TraversalUtil


    FontAndStyleFinder finder = new FontAndStyleFinder(runFontSelector, fontsDiscovered, null);
    finder.defaultCharacterStyle = this.getStyleDefinitionsPart().getDefaultCharacterStyle();
    finder.defaultParagraphStyle = this.getStyleDefinitionsPart().getDefaultParagraphStyle()
    finder.styleDefinitionsPart = this.getStyleDefinitionsPart();
   
    new TraversalUtil(bodyChildren, finder);
//    finder.finish();
   
    fontsDiscovered.add(
        runFontSelector.getDefaultFont() );
   
View Full Code Here


    FontAndStyleFinder finder = new FontAndStyleFinder(null, null, stylesInUse);
    finder.defaultCharacterStyle = this.getStyleDefinitionsPart().getDefaultCharacterStyle();
    finder.defaultParagraphStyle = this.getStyleDefinitionsPart().getDefaultParagraphStyle();
    finder.styleDefinitionsPart = this.getStyleDefinitionsPart();
   
    new TraversalUtil(bodyChildren, finder);
    finder.finish();
   
    // Styles in headers, footers?
    RelationshipsPart rp = this.getRelationshipsPart();
    if (rp!=null) {
View Full Code Here

      IgnorablePrefixFinder finder = new IgnorablePrefixFinder();
      if (body.getSectPr()!=null
        && body.getSectPr().getFootnoteColumns()!=null) {
          finder.needW15 = true;                         
      }
      new TraversalUtil(content, finder);
     
      String mceIgnorableVal = "";
      if (finder.needW14) {
        mceIgnorableVal = "w14";
      }
View Full Code Here

    // The inefficient case, where we calculate again
    log.warn("Recalculating starting value for new bookmarks.  For efficiency, you should set this in your code.");
    int highestId = 0;
   
    RangeFinder rt = new RangeFinder("CTBookmark", "CTMarkupRange");
    new TraversalUtil(wordMLPackage.getMainDocumentPart().getContent(), rt);
   
    for (CTBookmark bm : rt.getStarts()) {
     
      BigInteger id = bm.getId();
      if (id!=null && id.intValue()>highestId) {
View Full Code Here

    }
  }

  private void findSdtsInTemplatePart(ContentAccessor content, TopLevelSdtTemplateFinder sdtPrFinder) throws Docx4JException {
   
    new TraversalUtil(content.getContent(), sdtPrFinder);
 
View Full Code Here

  private TopLevelSdtInstanceFinder instanceSdtPrFinder;
  private void handleSdtsInInstancePart(ContentAccessor content ) throws Docx4JException {
   
    instanceSdtPrFinder = new TopLevelSdtInstanceFinder();   
    new TraversalUtil(content.getContent(), instanceSdtPrFinder);
   
    // Handle the condition sdt's we've found
    replaceConditions();
   
    handleRepeats();
View Full Code Here

    org.docx4j.wml.Document wmlDocumentEl = (org.docx4j.wml.Document) documentPart
        .getJaxbElement();
    Body body = wmlDocumentEl.getBody();

    new TraversalUtil(body,

    new Callback() {

      String indent = "";
View Full Code Here

    // Create the CustomXML parts
    createParts(pkgOut);
   
    // Operate at the p level
    PFinder pFinder = new PFinder();
        new TraversalUtil(pkgOut.getMainDocumentPart().getContent(), pFinder);

        for ( P p : pFinder.pList) {
         
          List<Object> replacementContent = new ArrayList<Object>();
         
View Full Code Here

    log.debug("complexified: "
        + XmlUtils.marshaltoString(pkgOut.getMainDocumentPart().getJaxbElement(), true));
   
    // find fields
    ComplexFieldLocator fl = new ComplexFieldLocator();
    new TraversalUtil(pkgOut.getMainDocumentPart().getContent(), fl);
    log.info("Found " + fl.getStarts().size() + " fields ");
   
   
    // canonicalise and setup fieldRefs
    List<FieldRef> fieldRefs = new ArrayList<FieldRef>();
View Full Code Here

    sections = new ArrayList<SectionWrapper>();
   
      // Find the sectPrs
      SectPrFinder sf = new SectPrFinder(wordMLPackage.getMainDocumentPart());
    try {
      new TraversalUtil(wordMLPackage.getMainDocumentPart().getContents(), sf);
    } catch (Docx4JException e) {
      log.error(e.getMessage(), e);
   
   
    for (SectPr sectPr : sf.getOrderedSectPrList() ) {
View Full Code Here

TOP

Related Classes of org.docx4j.TraversalUtil

Copyright © 2018 www.massapicom. 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.