Page 1 of 1

Databinding and format properties

PostPosted: Fri Jun 01, 2012 12:49 am
by Adolar
Hello everyone,

I use a docx-template and databinding for generation of a docx-file. So I equiped the template with content controls and custom XML parts and inject my custom XML data file. The template contains tables and of course table rows and table cells. The databinding process works very good and so I get filled tables.

I want to color table cells depends of its content. One possible solution is to save the bound docx-document, reopen it, searching the relevant JAXB-node via XPath, analyse the content, change the color and save again. Searching the relevant node without save and reopen the document throws an XPathExpressionException.

There are ideas to change any format properties close to the binding step? Can I arrange the bound docx so that I don't get an XPathExpressionException when I use getJAXBNodesViaXPath() ?

Thank you,
Adolar

Re: Databinding and format properties

PostPosted: Fri Jun 01, 2012 3:38 pm
by jason
https://github.com/plutext/docx4j/commi ... 8c2b88ca87 should fix the issue with using xpath on the resulting docx.

As to table cell formatting based on content, I'm not aware of any plans to implement this. Perhaps you could sketch out how it might work, then we can take it from there...