castor
  1. castor
  2. CASTOR-1967

Code generation from schema containing anonymous complex types

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.1
    • Fix Version/s: None
    • Component/s: XML code generator
    • Labels:
      None
    • Number of attachments :
      4

      Description

      Code generated from schemas containing anonymous complex does not seem correct when default binding type is set to "type".

      The attached schema (IBConfiguration.xsd) attempts to demonstrate the problem. Whenever code is generated from this schema (and warnings are enabled) the code generator gives the warning "Warning: A class name generation conflict has occured between element '/IBConfiguration/Servers' and element '/IBConfiguration'".

      I've attached all the source files that are generated from this schema (generated_code.zip). A class has been generated for the top-level complex type, but classes haven't been generated for the anonymous complex types (which they were with version 1.0.1) and their elements. A strange class named "null" has been generated which appears to contain the code for one these complex types.Maybe each anonymous complex type is given the name "null"?

      Sorry if I've missed any information, please let me know if you require anything else.

      Best Regards,
      Richard

        Activity

        Hide
        Werner Guttmann added a comment -

        With a previous version, what classes had been generated ?

        Show
        Werner Guttmann added a comment - With a previous version, what classes had been generated ?
        Hide
        Richard Stokes added a comment -

        I've attached the code generated by version 1.0.1.

        After examing this code again I've realised that my initial description isn't quite correct. With 1.0.1 classes aren't generated for the anonymous complex types themselves, but for they elements they belong to.

        Sorry for any confusion caused this caused.

        Show
        Richard Stokes added a comment - I've attached the code generated by version 1.0.1. After examing this code again I've realised that my initial description isn't quite correct. With 1.0.1 classes aren't generated for the anonymous complex types themselves, but for they elements they belong to. Sorry for any confusion caused this caused.
        Hide
        Werner Guttmann added a comment -

        Is 1.0.1 really the last release which your XML schema is working with completely ? Just trying to get an idea as to how far I have to go back to check out old code and step through things.

        Show
        Werner Guttmann added a comment - Is 1.0.1 really the last release which your XML schema is working with completely ? Just trying to get an idea as to how far I have to go back to check out old code and step through things.
        Hide
        Richard Stokes added a comment -

        It seems to be at version 1.0.4 that something changed. With 1.0.4 the generated code does not compile (I can attach the error and source if you like).

        The behaviour of 1.0.5 seems to match 1.1.1.

        Show
        Richard Stokes added a comment - It seems to be at version 1.0.4 that something changed. With 1.0.4 the generated code does not compile (I can attach the error and source if you like). The behaviour of 1.0.5 seems to match 1.1.1.
        Hide
        Werner Guttmann added a comment -

        Thanks, that's already sufficient information. No need to attach anything.

        Show
        Werner Guttmann added a comment - Thanks, that's already sufficient information. No need to attach anything.

          People

          • Assignee:
            Werner Guttmann
            Reporter:
            Richard Stokes
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: