3

I have an XML Schema file describing a larger XML structure. For documentation reason and to help the later user/programmer using this structure I added extensive comments to each element and field, e.g. like:

...
<xs:element name="eventId" type="xs:string" minOccurs="1" >
    <xs:annotation>
        <xs:documentation>my comment here...</xs:documentation>
    </xs:annotation>
</xs:element>
...

I am using JAXB to create the corresponding Java classes from this schema (which yields two jars: <elementname>.jar containing the .class files and <elementname>_src.jar containing the corresponding sources). I am using Eclipse 4.3/Kepler for this step (schemafile -> right click -> generate XML data bindings).

For reference and easier access to the documentation (e.g. using javadoc) I would like the latter to also contain the documentation from the original schema file.

Can one somehow teach JAXB to include the texts from the documentation-elements into the generated Java source?

Hope I could make myself clear...

mmo
  • 3,897
  • 11
  • 42
  • 63

0 Answers0