jaxb2-annotate-plugin icon indicating copy to clipboard operation
jaxb2-annotate-plugin copied to clipboard

Remove all annotations of a certain type

Open bcluap opened this issue 4 years ago • 1 comments

Is it possible to use this plugin to remove all annotations of a certain type off all the generated classes. E.g. I want to ensure the generated source does not include @XmlSchemaType on any fields but don't want to have to do this on each and every field I tried this:

<jaxb:bindings schemaLocation="service.xsd" node="/xs:schema"> <jaxb:bindings node="//xs:element"> <annox:removeAnnotation class="javax.xml.bind.annotation.XmlSchemaType" /> </jaxb:bindings> </jaxb:bindings>

But get an error: lineNumber: 17; columnNumber: 44; XPath evaluation of "//xs:element" results in too many (176) target nodes

bcluap avatar Aug 16 '20 22:08 bcluap

You can defined the "not recognized" but existing attribute multiple="true" to get rid of the message and get the goal you want to do @bcluap (response more for reference, hope you're not waiting for more than 3 years for the fix 😄)

laurentschoelens avatar Jan 09 '24 15:01 laurentschoelens