For verbose XSD enumeration values, perhaps enumeration like following would be better,
<xs:enumeration value='AIRPORT_TYPE_1'>
<xs:annotation>
<xs:documentation>active civil airport</xs:documentation>
</xs:annotation>
</xs:enumeration>
Hi Folks,
This simpleType has a list of enumeration values:
<xs:simpleType name="AirportType">
<xs:restriction base="xs:string">
<xs:enumeration value="active civil airport" />
<xs:enumeration value="active military airport" />
<xs:enumeration value="active joint (civil and military)" />
<xs:enumeration value="active airport having permanent type surface runways" />
</xs:restriction>
</xs:simpleType>
What do you think about those enumeration values? Good? Bad?
A colleague told me: Whitespaces in enumeration values are evil." Do you agree? On the one hand, whitespace enables a value to be easily read. On the other hand, when someone is creating an XML document they might accidentally insert two spaces between words, thus yielding invalid data. Whitespaces good or bad?
The same colleague recommended slamming the words together, and uppercase the first letter of following words, e.g., change "active civil airport" to "activeCivilAirport". But what about values with punctuation such as this value "active joint (civil and military)"? Slamming those words together will create a mess. Should punctuation be prohibited in enumeration values?
This is a pretty long enumeration value: "active airports having permanent type surface runways". Are long values bad? Is there a recommended limit to the length of enumeration values?
I am interested in hearing your thoughts on this issue.
--