Question

How can I produce a 'filtered' version of an XSD (ie minus certain elements) as part of a Maven build?

An API I'm working on has it's model defined by an XSD, which is turned into Java classes by XJC. I want to have annotations appear in the generated classes, and should be able to do this via the JAXB2 Basics Annotate plugin.

We may need to provide a copy of the XSD to integration partners as a definition of the API. We would not want them seeing the elements of the XSD relating to Java annotations, so it would be good if we could produce a new version of the XSD with each build that has all the annotate elements removed.

Était-ce utile?

La solution

An XSD is still an XML file. You could use an XSLT to create a version specific to your needs. The maven xml plugin can do this as part of the build.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top