Disclaimer: I am the author of the Simplify plugin, which is part of the JAXB2 Foundation .
The plugin is a good and lively project, but my documentation server dies from time to time. I don’t have the resources to support my own hosting, so I transfer all my projects to GitHub.
Here you can find the JAXB2 Basics project:
https://github.com/highsource/jaxb2-basics
The documentation has not yet been moved, but here is a link to one of the test projects that use it:
https://github.com/highsource/jaxb2-basics/tree/master/tests/issues
The following is a schema fragment that uses the simplify:as-element-property setting simplify:as-element-property :
<xs:complexType name="gh1" mixed="true"> <xs:sequence> <xs:element name="a" type="xs:string"> <xs:annotation> <xs:appinfo> <simplify:as-element-property/> </xs:appinfo> </xs:annotation> </xs:element> <xs:element name="b" type="xs:int"/> </xs:sequence> </xs:complexType>
I will return the server in a few hours.
Please post your circuit / setup for verification. The problem you have is probably that you made the setting in the wrong place. This is sometimes difficult to understand.
Update
This error:
"Unsupported binding namespace "http://jaxb2-commons.dev.java.net/basic/simplify". Perhaps you meant "http://jaxb.dev.java.net/plugin/code-injector"?"
Indicates that the plugin is missing or not activated. I assume you are using maven-jaxb2-plugin . Then make sure you have jaxb2-basics as a JAXB2 plugin, and the -Xsimplify switch is also on. Here's a sample :
<plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <configuration> <extension>true</extension> <args> <arg>-Xsimplify</arg> </args> <plugins> <plugin> <groupId>org.jvnet.jaxb2_commons</groupId> <artifactId>jaxb2-basics</artifactId> </plugin> </plugins> </configuration> </plugin>
Then your initial mistake, “unable to comply with this ... setting”, may be related to the WHERE that you are posting. You put it in an element (which I will do).
But in some cases, the XJC reads these settings from other components of the circuit. In your case, try putting the setting on xs:choice .
If the error persists, write the problem to GitHub, providing a minimal scheme that reproduces the error. Then I will take care of him.
Update 2
The server is back online, but now I have moved the JAXB2 Simplify Plugin documentation to GitHub:
https://github.com/highsource/jaxb2-basics/wiki/JAXB2-Simplify-Plugin
Update 3
The final solution with version 0.9.1 is given here:
https://github.com/highsource/jaxb2-basics/issues/3
Set up the class as follows:
<simplify:property name="type2OrType3"> <simplify:as-element-property/> </simplify:property>
An example .