I would like to create a watermark document. I generate the following microsoft office xsd: com.microsoft.schemas.office.vml, com.microsoft.schemas.office.word,com.microsoft.schemas.office.office,com.microsoft.schemas.office.powerpoint,com.microsoft.schemas.office.office.excel using JAXB. I would like to know how can I integrate into docx4j. Somehow I need to let docx4j know about my JAXBContext before it can marshall or unmarshall. Could you please let me know how to do this? Thanks for your help.
Here's my code:
.......
javax.xml.namespace.QName qname7 = new javax.xml.namespace.QName(
"urn:schemas-microsoft-com:vml", "shapetype");
JAXBElement jeShapeType = this.getJAXBElement(qname7, CTShapetype.class, shapeType);
pict.getAnyAndAny().add(jeShapeType);
javax.xml.namespace.QName qname8 = new javax.xml.namespace.QName(
"urn:schemas-microsoft-com:vml", "shape");
JAXBElement jeShape = this.getJAXBElement(qname8, CTShape.class, shape);
pict.getAnyAndAny().add(jeShape);
but I get an error when save the doucment "wp.save(filename)", here is my error:
javax.xml.bind.MarshalException
- with linked exception:
[javax.xml.bind.JAXBException: com.microsoft.schemas.vml.CTShapetype is not known to this context]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:304)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:230)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:75)