Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case sensitive attributte names are threated as insensitive #114

Open
tomasz-kusy opened this issue Jun 8, 2020 · 3 comments
Open

Case sensitive attributte names are threated as insensitive #114

tomasz-kusy opened this issue Jun 8, 2020 · 3 comments

Comments

@tomasz-kusy
Copy link

Hi,
Example:

<xs:complexType name="POCD_MT000040.Section">
   <xs:sequence>
	<xs:element name="realmCode" type="CS" minOccurs="0" maxOccurs="unbounded"/>
	<xs:element name="typeId" type="POCD_MT000040.InfrastructureRoot.typeId" minOccurs="0"/>
	<xs:element name="templateId" type="II" minOccurs="0" maxOccurs="unbounded"/>
	<xs:element name="id" type="II" minOccurs="0"/>
   </xs:sequence>
   <xs:attribute name="ID" type="xs:ID"/>
</xs:complexType>

We have id and ID. Yes, it's really "not clever" at all but true and correct :)

In class generator ucwords() is used. So generator tries to generate getId() method x2 and throws an exception.

@tomasz-kusy tomasz-kusy changed the title Case sensitive attributte name are threated as insensitive Case sensitive attributte names are threated as insensitive Jun 8, 2020
@goetas
Copy link
Member

goetas commented Jun 10, 2020

This is an interesting edgecase, do you have a solution to suggest?

@tomasz-kusy
Copy link
Author

I've been thinking about it and probably I have no good idea.
It can add a new configuration parameter like "case insensitive xml" - default true. By default, the generator would work like now "getId" - camel case. But after setting it to false the name of the method would be created like "get_ID" and get_id".

@goetas
Copy link
Member

goetas commented Jun 13, 2020

I've been thinking about it and probably I have no good idea.
It can add a new configuration parameter like "case insensitive xml" - default true. By default, the generator would work like now "getId" - camel case. But after setting it to false the name of the method would be created like "get_ID" and get_id".

if that will solve your issue, I'm happy to accept a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants