Menu

#15 No support for documentation on Attributes

1.0
open
None
2021-06-17
2021-06-04
No

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>

Discussion

  • Dave Kuhlman

    Dave Kuhlman - 2021-06-05

    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

     
  • Dave Kuhlman

    Dave Kuhlman - 2021-06-17

    Robert,

    I've done some work on this. The latest version of generateDS now creates doc strings from the annotation/documentation on a complexType. When there is documentation on a child element or an attribute in the complexType, generateDS attempts to attach that to the class formatted as reStructuredText unordered lists (so that they can be formatted by Sphinx.

    I suspect that there are still some cases that it does not handle, for example attributeGroup and model group (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

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.