No support for documentation on Attributes
Brought to you by:
dkuhlman
It does not appear that XschemaAttribute supports access to documentation. This is however supported by SimpleTypeElement and XschemaElement. Is this an oversight or by design? With the current implementation it does not appear possible to access the documentation in the following example.
<xs:complexType name="TAddress">
<xs:attribute name="NameOfAddress" type="xs:string">
<xs:annotation>
<xs:documentation xml:lang="en">
NameOfAddress of the Address
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
Robert,
Thanks for this suggestion.
I'm starting work on another possible enhancement that also concerns generation of doc strings. I'll look into support for attributes at the same time.
Dave
Robert,
I've done some work on this. The latest version of
generateDS
now creates doc strings from the annotation/documentation on acomplexType
. When there is documentation on a child element or an attribute in thecomplexType
,generateDS
attempts to attach that to the class formatted as reStructuredText unordered lists (so that they can be formatted bySphinx
.I suspect that there are still some cases that it does not handle, for example
attributeGroup
and modelgroup
(reusable groups of child elements). But, I've burned enough time on this for now. Maybe later, if and when that becomes a problem, ...I've uploaded the version containing these changes to SourceForge and PyPI.
I apologize for taking so long. I really struggled while trying to find the correct object to attach the doc strings to. The part of the implementation where that needs to be done uses a very old XML parser called SAX (simple API for XML). It's horridly awkward to work with, but there is too much code to rip out and replace. I finally implemented a work-around, or maybe it's the strategy I should have used from the beginning.
Thanks again for the report. If/when you try the new version, please let me know whether it works for you.
Dave