mganss / XmlSchemaClassGenerator

Generate C# classes from XML Schema files
Apache License 2.0
589 stars 179 forks source link

Add option to use "Legacy" pascal case naming #520

Closed Pretasoc closed 2 months ago

Pretasoc commented 2 months ago

As the old saying goes 'Every change breaks someones workflow'. This time it hit me.

I have an externally supplied xsd file which contains underscores in element names. I used to generate the classes with 2.0.732. In that version the generated classes would contain underscores as well (<element name="foo_bar" /> became class Foo_Bar). When i now tried to update to to the changes in 46b2dc3a0370f4042940cdce7fcffa0519039930 underscores are now removed from identifiers.

Carring that change forward in my project is not an option as is would affect some downstream applications, that rely on that generated type names. For now i will stay on the old version, but it would be great to have an upgrade path available.

mganss commented 2 months ago

Oh crap, I'm sorry 😳 Do you think you could get by with a type name mapping file (--tnsf option)?

Pretasoc commented 2 months ago

I'll take a look at it. Im not sure how easy it will be to generate the mapping file. But i guess it should be possible with an xslt script.

mganss commented 2 months ago

I've added an option to use the legacy naming scheme (--namingScheme=Legacy).