castor
  1. castor
  2. CASTOR-2578

Creating element type with NMTOKENS does not generate in correct package

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3 rc1
    • Fix Version/s: 1.3
    • Component/s: XML code generator
    • Labels:
      None
    • Testcase included:
      yes
    • Number of attachments :
      4

      Description

      When creating an element type instead of adding properties directly in the element so that the type can be reused there are problems for NMTOKENS. For example, the Details element from below does not get generated in the same package and location as DetailsIn. This does not happen if the restricted type is something else like int, string, etc.

                <xs:complexType>
      			<xs:sequence>
      				<xs:element name="DetailsOut" type="fsd:DetailType"></xs:element>
      				<xs:element name="DetailsIn">
      					<xs:simpleType>
      						<xs:restriction base="xs:NMTOKENS">
      							<xs:enumeration value="ZERO"></xs:enumeration>
      							<xs:enumeration value="ONE"></xs:enumeration>
      						</xs:restriction>
      					</xs:simpleType>
      				</xs:element>
      			</xs:sequence>
      	</xs:complexType>
      
              <xs:simpleType name="DetailType">
      		<xs:restriction base="xs:NMTOKENS">
      			<xs:enumeration value="TWO"></xs:enumeration>
      			<xs:enumeration value="THREE"></xs:enumeration>
      		</xs:restriction>
      	</xs:simpleType>
      
      1. castorbuilder.properties
        2 kB
        Renee Rivas
      2. patch.c2578.20081118.txt
        0.6 kB
        Werner Guttmann
      3. TokenExample.xsd
        2 kB
        Renee Rivas
      4. TsbSchema.xpr
        0.3 kB
        Renee Rivas

        Activity

        Hide
        Renee Rivas added a comment -

        I tried downloading the 1.3rc1 source from http://dist.codehaus.org/castor/1.3rc1/, and also the current trunk, but both had build issues.

        The rc1 had problems with SourceGenerator, which is odd since it had a jar out. Is there something special I need to do to build it?

        Will you be posting the snapshot on snapshots.repository.codehaus.org?

        Show
        Renee Rivas added a comment - I tried downloading the 1.3rc1 source from http://dist.codehaus.org/castor/1.3rc1/ , and also the current trunk, but both had build issues. The rc1 had problems with SourceGenerator, which is odd since it had a jar out. Is there something special I need to do to build it? Will you be posting the snapshot on snapshots.repository.codehaus.org?
        Hide
        Werner Guttmann added a comment -

        With 1-3rc1 and higher, you can only use Maven to build Castor. Can I safely assume you have done that ? Yes, I will be posting a snapshot release once I have committed two issues.

        Show
        Werner Guttmann added a comment - With 1-3rc1 and higher, you can only use Maven to build Castor. Can I safely assume you have done that ? Yes, I will be posting a snapshot release once I have committed two issues.
        Hide
        Renee Rivas added a comment -

        yes, I was using maven 2.0.7, with mvn install and mvn package. I'll just wait for the snapshot. Will it require me to upgrade to snapshots of all the other castor libraries (xml, schema, etc)?

        Show
        Renee Rivas added a comment - yes, I was using maven 2.0.7, with mvn install and mvn package. I'll just wait for the snapshot. Will it require me to upgrade to snapshots of all the other castor libraries (xml, schema, etc)?
        Hide
        Werner Guttmann added a comment -

        yes, I was using maven 2.0.7, with mvn install and mvn package.

        In that case I'd like to learn more about those problems. Feel like opening a new issue ?

        Show
        Werner Guttmann added a comment - yes, I was using maven 2.0.7, with mvn install and mvn package. In that case I'd like to learn more about those problems. Feel like opening a new issue ?
        Hide
        Werner Guttmann added a comment -

        Will it require me to upgrade to snapshots of all the other castor libraries (xml, schema, etc)?

        Yes, pretty please. Just to be on the safe side of things .....

        Show
        Werner Guttmann added a comment - Will it require me to upgrade to snapshots of all the other castor libraries (xml, schema, etc)? Yes, pretty please. Just to be on the safe side of things .....

          People

          • Assignee:
            Werner Guttmann
            Reporter:
            Renee Rivas
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 hour, 30 minutes
              1h 30m