- Code: Select all
org.docx4j.wml.ObjectFactory factory = new org.docx4j.wml.ObjectFactory();
org.docx4j.wml.CTBookmark bookmarkStart = factory.createCTBookmark();
bookmarkStart.setName("something");
Unfortunately I can't figure out how to create a BookmarkEnd. Reading the forum I found this thread http://dev.plutext.org/forums/viewtopic.php?f=6&t=161&hilit=CTBookmark&sid=62b7ec089f118a4202d955b5dc51fff1 and though that perhaps BookmarkEnd is represented by org.docx4j.wml.CTMarkupRange. However when I insert a CTMarkupRange in the document I get an exception when I save it:
- Code: Select all
19:46:44,001 ERROR org.docx4j.openpackaging.parts.JaxbXmlPart:182 [] javax.xml.bind.MarshalException
javax.xml.bind.MarshalException
- with linked exception:
[com.sun.istack.SAXException2: unable to marshal type "org.docx4j.wml.CTMarkupRange" as an element because it is missing an @XmlRootElement annotation]
- with linked exception:
[com.sun.istack.SAXException2: unable to marshal type "org.docx4j.wml.CTMarkupRange" as an element because it is missing an @XmlRootElement annotation]
What am I doing wrong? Or rather, how should I do it right?