castor
  1. castor
  2. CASTOR-1931

enumBinding in bindings file does not always work with code generator

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.1.1
    • Component/s: XML code generator
    • Labels:
      None
    • Environment:
      Win XP
    • Number of attachments :
      2

      Description

      The code generator appears to not honor some enumBinding specifications in binding file. Using attached test bindings file, output will be the same regardless of whether or not bindings file is specified when generating code.

      How it was run from command line:

      java.org.exolab.castor.builder.SourceGeneratorMain -i schematest\enumBindingTest.xsd -package org.whatever.btest -binding-file testbinding.xml

      Castor did appear to be at least examining the bindings file, as adding something invalid to the bindings file would result in an error while parsing the bindings file.

      Using the included example, the generated file includes:

      /**

      • The 5810 type
        */
        public static final int VALUE_5810_TYPE = 0;

      /**

      • The instance of the 5810 type
        */
        public static final OrganizationalType VALUE_5810 = new OrganizationalType(VALUE_5810_TYPE, "5810");

      The goal was to have the VALUE_5810 renamed as specified in the bindings file.

      1. enumBindingTest.xsd
        1.0 kB
        Scott C Arnold
      2. testbinding.xml
        0.4 kB
        Scott C Arnold

        Activity

        Hide
        Scott C Arnold added a comment -

        Example Bindings File

        Show
        Scott C Arnold added a comment - Example Bindings File
        Scott C Arnold made changes -
        Field Original Value New Value
        Attachment testbinding.xml [ 26583 ]
        Hide
        Scott C Arnold added a comment -

        Example Schema

        Show
        Scott C Arnold added a comment - Example Schema
        Scott C Arnold made changes -
        Attachment enumBindingTest.xsd [ 26584 ]
        Hide
        Scott C Arnold added a comment -

        The directory layout used with the attached example files was as follows:

        e:/java/testbinding.xml
        e:/java/schematest/enumBindingTest.xsd

        Command line execution of the code generator was run from e:/java

        Show
        Scott C Arnold added a comment - The directory layout used with the attached example files was as follows: e:/java/testbinding.xml e:/java/schematest/enumBindingTest.xsd Command line execution of the code generator was run from e:/java
        Werner Guttmann made changes -
        Assignee Werner Guttmann [ wguttmn ]
        Werner Guttmann made changes -
        Remaining Estimate 1 hour [ 3600 ]
        Fix Version/s 1.1.1 [ 13080 ]
        Original Estimate 1 hour [ 3600 ]
        Werner Guttmann made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ralf Joachim made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Werner Guttmann
            Reporter:
            Scott C Arnold
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1 hour
              1h
              Remaining:
              Remaining Estimate - 1 hour
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified