users@jaxb.java.net

Re: XSD annotation/documentation to Javadoc request

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_sun.com>
Date: Wed, 25 Jun 2003 11:06:49 -0400

Gary Gregory wrote:

> Hello,
>
> It would be quite helpful if XSD annotations would show up as Javadoc
> comments.
>

Agreed. The specification left some wiggle room to not implement it:

"Class-level javadoc is a combination of a documentation annotation from
the schema component and/or javadoc specified within customization."

There are similar statements all over the spec for other schema components.
It simply isn't as important as supporting more of the W3C XML Schema spec,
so we haven't implemented it yet, but it's still on our list of things to
implement - we'll make sure to consider it more seriously now that we've
gotten feedback that people are interested in it.

As Ed pointed out, you can duplicate the annotation documention in javadoc
customizations for the time being.

Thanks for the feedback...

--Ryan

> For example, the following:
>
> <xs:attribute name="maxConnectionsPerHost"
> type="cics:positiveShort" use="optional" default="2">
> <xs:annotation>
> <xs:documentation>Sets the maximum number of
> connections allowed for a given HostConfiguration. Per RFC 2616 section
> 8.1.4, this value defaults to 2.</xs:documentation>
>
> </xs:annotation>
> </xs:attribute>
>
> Would show up as:
>
> /**
> * Sets the maximum number of connections allowed for a
> * given HostConfiguration. Per RFC 2616 section 8.1.4,
> * this value defaults to 2.
> */
>
> I've formatted this so it fits nicely in an email message but I think
> the format should not be changed from what is in the
> annotation/documentation element.
>
> The reason I bring this is up is that some tools like XMLSpy support
> this scheme to document XSDs, which is how we document our XSDs.
>
> Gary
>