quayle / xplus-xsd2cpp

Automatically exported from code.google.com/p/xplus-xsd2cpp
GNU Lesser General Public License v3.0
0 stars 0 forks source link

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

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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: