I am creating a docx with 2 rich text controls and 1 picture control. I open content control toolkit, create 1 custom xml part, type in the xml and bind xml tags to the content controls. I save the mapping and close it. When I reopen the docx, I see 3 custom xml parts created. All 3 with all the content controls. I am surprised why it would do that. As a result, when I apply the bindings using docx4j API, the data gets updated in the last custom xml part. Guess the output docx only shows the first custom xml part and hence I dont see any bound values. When I unzipped the docx and looked at the contents, I see that the last cutom xml part has been updated with the values, I set using the docx4j code. Am I doing anything different that makes content control toolkit create the extra custom xml parts? Please let me know.
Asked
Active
Viewed 509 times
1 Answers
0
If you look at the w:dataBinding elements, do they each have the same @w:storeItemID values?
Given your description, you'd expect a different value for each content control. If that's the case, docx4j should respect that. That is, it ought to use whatever is in the three custom XML parts. (The standard code for first injecting the XML will only inject it into one part though)
As a general comment, most docx4j users (me included) would use an OpenDoPE AddIn, not the content control toolkit, so I can't comment on its behaviour.

JasonPlutext
- 15,352
- 4
- 44
- 84
-
Yes, all 3 xml parts have the same item ID. Like I mentioned, all 3 xml parts have all 3 content controls. I did try to install the opendope add-in, which gave me a certificate error. I have emailed you about this. Once we have a solution, maybe I will post it on stackoverflow for others to know. – Artin Apr 08 '14 at 13:34