Page 1 of 1

[BUG] Exception during picture content control binding

PostPosted: Sat Aug 18, 2012 3:27 am
by olabrosse
I'm not active on GitHub so I'll post my bug report here.

I found an issue where picture content controls inside condition controls are not binding properly.

Here's the root exception's stack trace:

[com.sun.istack.internal.SAXException2: unable to marshal type "java.lang.String" as an element because it is missing an @XmlRootElement annotation]
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(Unknown Source)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(Unknown Source)
at org.docx4j.XmlUtils.marshaltoW3CDomDocument(XmlUtils.java:535)

The fix is pretty simple: change line 526 of BindingHandler to marshall run instead of r.

Cheers.

-Olivier

Re: [BUG] Exception during picture content control binding

PostPosted: Fri Sep 14, 2012 9:26 am
by jason
A belated thanks for this Olivier; I have applied your fix in my source tree.