Normalization of Gosu generated XSD-based names
In cases where Gosu creates type names and element names, Gosu performs slight normalization of the names:
- One prominent aspect of normalization is capitalization to conform to Gosu naming standards for packages, properties, and types. For example, Gosu packages become all lowercase. Types must start with initial capitals. Properties must start with initial capitals.
- If the type or property
names contains invalid characters for Gosu for that context, Gosu changes
them. For example, hyphens are disallowed and removed.
- If Gosu finds an invalid character and the following character is lowercase, Gosu removes the invalid character and uppercases the following letter.
- If Gosu finds an invalid character and the following character is uppercase, Gosu converts the invalid character to an underscore and does not change the following character.
- If the first character is invalid as a first character but otherwise valid, such as a numeric digit, Gosu adds an underscore prefix. If the first character is entirely invalid in a name in that context, such as a hyphen, Gosu removes the character. If after removing multiple start characters, no characters remain, Gosu uses an underscore character as the name.
- If names would be duplicates, Gosu appends numbers to remove
ambiguity. For example, duplicates of the name
MyPropbecomeMyProp2,MyProp3, and so on.
