Page 1 of 1

Schema documentation of more complicated attribute types

Posted: Tue Nov 02, 2010 2:47 am
by Christian Roth
Hello,

is there a way to generate fully expandable schema documentation for more complicated attribute structures? It seems only the top level (restriction, union, ...) is documented, but not the descendants.

My type at hand looks like this (simplified):

Code: Select all

<xs:attribute name="name" use="required" form="qualified">
<xs:annotation>
<xs:documentation>name of the document property</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="title">
<xs:annotation>
<xs:documentation>title of the document</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="subject">
<xs:annotation>
<xs:documentation>subject of the document</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value=".+"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
(I know that the type effectively does allow any string. It was created this way so that a set of standard values could be documented.)

The generated documentation only shows as

Type union of(restriction of xs:string, restriction of xs:string)

but there's no way to descend into the two restrictions, where especially the first enumeration restriction with the documentation of the standard values is of interest.

Can complete (hierarchical) documentation of attribute types be enabled by a certain setting of options in the documentation generator, or does this require a customization of the HTML generating stylesheets?

Thanks,
Christian

Re: Schema documentation of more complicated attribute types

Posted: Tue Nov 02, 2010 1:01 pm
by adrian
Hello,

I'm afraid this situation is not handled well by the schema documentation tool. The actual restriction rules aren't represented for anonymous types.
There's no option nor any customization of the stylesheets that can resolve this.

I've added this to our issue tracking tool and we will attempt to find a way to better represent anonymous types with restrictions.


A workaround(though very inconvenient) is to alter the schema and make global(and named) the two anonymous simple types from the union. This will result in the proper documentation for them which includes the enumerations.

Regards,
Adrian

Re: Schema documentation of more complicated attribute types

Posted: Tue Nov 02, 2010 1:15 pm
by Christian Roth
Thanks Adrian. I will check out the workaround and see if it's feasible in my case.

Regards, Christian