Shorter class names for nested types

Dec 18, 2012 at 9:00 AM

Raising this old question because evidently the owner of the project either hasn't seen it, or forgotten about it;

One thing that I find annoying is the names generated for classes. I've ended up with a class name that's over 40 chars long simply because it's nested within the XSD. Is there anyway of telling the code generator to simply use the Element Name. Something like a flag to tell it to shorten the name, maybe?

In the example below, when generating, the class that is generated from the currentstorage element is named PackageCurrentstorage, whereas I would like for it to be named simply Currentstorage

	      <xs:element name="package" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="currentstorage" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:attribute name="name" type="xs:string" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>

 

Coordinator
Dec 24, 2012 at 10:34 AM

Hello,

If you want shorter class names, you have to apdapt you schema like this (by using complextype) :

Dec 26, 2012 at 12:57 PM

Hello, and thanks for replying.

Unfortunately, in this case I have no control over the schema. Are there any plans for adding this behavior, say a flag that uses only the (current) element's name attribute, instead of adding to the "root" element's name?