Schema documentation of more complicated attribute types

This should cover W3C XML Schema, Relax NG and DTD related problems.
Christian Roth
Posts: 15
Location: Munich, Germany

Schema documentation of more complicated attribute types

Tue Nov 02, 2010 2:47 am

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
adrian
Posts: 2442

Re: Schema documentation of more complicated attribute types

Tue Nov 02, 2010 1:01 pm

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Christian Roth
Posts: 15
Location: Munich, Germany

Re: Schema documentation of more complicated attribute types

Tue Nov 02, 2010 1:15 pm

Thanks Adrian. I will check out the workaround and see if it's feasible in my case.

Regards, Christian
<oXygen/> XML Editor 16.1

Return to “XML Schemas”

Who is online

Users browsing this forum: No registered users and 1 guest