It is currently Wed Jan 08, 2025 8:01 am
<xpath id="EtFsy">
<dataBinding xpath="string-length(/Template[1]/SLD[1]/BusinessSystems[1]/BusinessSystem[1]/Products[1]/Product[1]/Vendor[1])>0" storeItemID="{B981C26E-07CC-4E04-8DB5-6381C1213442}"/>
</xpath>
Can not convert #BOOLEAN to a NodeList!
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
CTCustomXmlBlock ctCustomXmlBlock=new CTCustomXmlBlock();
CTCustomXmlPr ctCustomXmlPr=new CTCustomXmlPr();
ctCustomXmlBlock.getContent().add(ctCustomXmlPr);
ctCustomXmlBlock.setElement("customizedElement");
CTAttr ctAttr=new CTAttr();
ctAttr.setName("testAttrName");
ctAttr.setVal("testValue");
ctAttr.setParent(ctCustomXmlPr);
ctCustomXmlPr.getAttr().add(ctAttr);
P p=new P();
R r=new R();
Text t=new Text();
t.setValue("marked text here");
r.getContent().add(t);
p.getContent().add(r);
ctCustomXmlBlock.getContent().add(p);
wordMLPackage.getMainDocumentPart().getContent().add(ctCustomXmlBlock);
wordMLPackage.save(new java.io.File(System.getProperty("user.dir") + "/OUT_withCustomXml.docx") );
org.docx4j.openpackaging.parts.WordprocessingML.ImageJpegPart
File img = new File("logo.jpeg");
InputStream is = new BufferedInputStream(new FileInputStream(img));
ImageJpegPart imgJpgPart = new ImageJpegPart(new PartName("/word/media/image1.jpeg"));
imgJpgPart.setBinaryData(is);
wordMLPackage.getParts().put(imgJpegPart);
Total posts 10116 • Total topics 2845 • Total members 2076