Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Note:</strong> I'm the <a href="http://www.eclipse.org/eclipselink/moxy.php" rel="nofollow"><strong>EclipseLink JAXB (MOXy)</strong></a> lead and a member of the <a href="http://jcp.org/en/jsr/detail?id=222" rel="nofollow"><strong>JAXB (JSR-222)</strong></a> expert group.</p> <hr> <p><strong>UPDATE</strong></p> <p>We have been able to reproduce the error you are seeing in EclipseLink 2.4.1. We have not been able to reproduce the issue in the EclipseLink 2.4.2 or 2.5.0 streams. I would recommend downloading the latest 2.4.2 nightly build and trying it out:</p> <ul> <li><a href="http://www.eclipse.org/eclipselink/downloads/nightly.php" rel="nofollow">http://www.eclipse.org/eclipselink/downloads/nightly.php</a></li> </ul> <p>We are still investigating this issue to ensure that it is truly fixed.</p> <hr> <p><strong>ORIGINAL ANSWER</strong></p> <p>So far I have been unable to reproduce the results from your question when MOXy is used as the JAXB provider. Could you provide some additional information to help me reproduce your use case. Below is what I have tried so far:</p> <p><strong>Java Model</strong></p> <p>I took the Java model from the following location on GitHub:</p> <ul> <li><a href="https://github.com/plutext/docx4j/tree/master/src/main/java" rel="nofollow">https://github.com/plutext/docx4j/tree/master/src/main/java</a></li> </ul> <p><strong>jaxb.properties</strong></p> <p>I added a file called <code>jaxb.properties</code> in the <code>org.docx4j.wml</code> package to enable MOXy as the JAXB provider.</p> <pre><code>javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory </code></pre> <p><strong>Demo</strong></p> <p>Below is the demo code I used to try and reproduce the issue:</p> <pre class="lang-java prettyprint-override"><code>package org.docx4j.wml; import javax.xml.bind.*; import org.eclipse.persistence.Version; public class Demo { public static void main(String[] args) throws Exception { JAXBContext jc = JAXBContext.newInstance("org.docx4j.wml"); System.out.println(Version.getVersion()); System.out.println(jc.getClass()); Text text = new Text(); Marshaller marshaller = jc.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.marshal(text, System.out); } } </code></pre> <p><strong>Output</strong></p> <p>Below is the output from running the demo code. I'm seeing the proper root element <code>t</code> marshalled out instead of <code>delInstrText</code> as described in the question.</p> <pre><code>2.4.1 class org.eclipse.persistence.jaxb.JAXBContext &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;ns0:t xmlns:ns2="http://schemas.openxmlformats.org/schemaLibrary/2006/main" xmlns:ns1="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:ns4="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:ns3="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:ns0="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:ns5="http://schemas.openxmlformats.org/officeDocument/2006/relationships"/&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload