Skip to content

compilation breaks if schema contains complex-types with the same name as an element contained in the complex-type. #11

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Run xsd2cpp on the included test.xsd schema.  (xsd2cpp -s test.xsd test-lib) 

It contains a complex type named "testElementType" that contains an element 
also named "testElementType".

2. Configure and compile the generated code.

3. Compilation will fail with 

error: ISO C++ forbids nested type 'testElementType' with same name as 
enclosing class [-fpermissive]
   typedef XMLSchema::XmlElement<http_www_test_com_::Types::testElementEnum> testElementType;

What is the expected output? What do you see instead?
I would expect either xsd2cpp to detect the naming conflict and remedy the 
problem, or allow a naming override mechanism.


What version of the product are you using? On what operating system?
xsd2cpp: 0.2.1
OS: Ubuntu 14.04 64bit

Please provide any additional information below.
JAXB provides a mechanism to specify naming overrides in a config file.  This 
would be an acceptable solution to this problem.


Original issue reported on code.google.com by mjp5...@gmail.com on 1 Oct 2014 at 1:54

Attachments:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions