protected static void process(HeaderPart header, FieldVisitor fldVisitor) { if ((header != null) && (!header.getContent().isEmpty())) { TraversalUtil.visit(header.getContent(), fldVisitor); } }
protected static void process(HeaderPart header, FieldVisitor fldVisitor) { if ((header != null) && (!header.getContent().isEmpty())) { TraversalUtil.visit(header.getContent(), fldVisitor); } }
private void unresolvedExpressionsAreNotReplacedInHeader(WordprocessingMLPackage document) { HeaderPart headerPart = getHeaderPart(document); P fooParagraph = (P) headerPart.getContent().get(2); Assert.assertEquals("In this paragraph, the variable foo should not be resolved: ${foo}.", new ParagraphWrapper(fooParagraph).getText()); }
private void resolvedExpressionsAreReplacedInHeader(WordprocessingMLPackage document) { HeaderPart headerPart = getHeaderPart(document); P nameParagraph = (P) headerPart.getContent().get(1); Assert.assertEquals("In this paragraph, the variable name should be resolved to the value Homer Simpson.", new ParagraphWrapper(nameParagraph).getText()); }
public void walk() { RelationshipsPart relationshipsPart = document.getMainDocumentPart().getRelationshipsPart(); // walk through elements in headers List<Relationship> headerRelationships = getRelationshipsOfType(document, Namespaces.HEADER); for (Relationship header : headerRelationships) { HeaderPart headerPart = (HeaderPart) relationshipsPart.getPart(header.getId()); walkContent(headerPart.getContent()); } // walk through elements in main document part walkContent(document.getMainDocumentPart().getContent()); // walk through elements in headers List<Relationship> footerRelationships = getRelationshipsOfType(document, Namespaces.FOOTER); for (Relationship footer : footerRelationships) { FooterPart footerPart = (FooterPart) relationshipsPart.getPart(footer.getId()); walkContent(footerPart.getContent()); } }