Elements of this type seem to have raise issues in general:

I tried another approach to overcome the "java:java.lang.String"
issue. I explicitly declared the enumaration type and
used it in both the element and the attribute defintion.

Depending on which "org.exolab.castor.builder.javaclassmapping"
I am using I am getting a different error during source generation:

"element"

 Creating classes for element: ElementWithEnumeratedAttribute
 Creating classes for element: Main
 Creating classes for element: EnumeratedElement
 Type not found for element: EnumeratedElement
 
 => no class is generated for EnumeratedElement
    (but this class is referenced in class Main)

"type"

     Creating classes for element: Main
     java.lang.NullPointerException
         at
org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.ja
va, Compiled Code)
         at
org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.ja
va, Compiled Code)
         at
org.exolab.castor.builder.SourceFactory.processComplexType(SourceFactory.jav
a:1304)
         at org.exolab.castor.builder.SourceFactory.createSourceCode(Sour
         (and so on)
 => no class is generated for Main

here is the modified schema I was using for this:

----------------------------------------------------------------------------
------------
<?xml version = "1.0" encoding = "UTF-8"?>
<xsd:schema 
        xmlns:xsd="http://www.w3.org/2001/XMLSchema";
        xmlns:test="http://www.bednarik.com/test";
        xmlns="http://www.bednarik.com/test";
        targetNamespace="http://www.bednarik.com/test";
        elementFormDefault="unqualified" >
 
<xsd:simpleType name="YesNoType">
   <xsd:restriction base="xsd:string">
      <xsd:enumeration value="yes" />
      <xsd:enumeration value="no" />
   </xsd:restriction>
</xsd:simpleType>

<xsd:element name="Main">
   <xsd:complexType>
      <xsd:sequence>
         <xsd:element ref="EnumeratedElement" />
         <xsd:element ref="ElementWithEnumeratedAttribute" />
      </xsd:sequence>
   </xsd:complexType>
</xsd:element>       

<xsd:element name="EnumeratedElement" xsd:type="YesNoType" />

<xsd:element name="ElementWithEnumeratedAttribute" >
   <xsd:complexType>
      <xsd:attribute name="flag" xsd:type="YesNoType" />
   </xsd:complexType>
</xsd:element>

</xsd:schema>
----------------------------------------------------------------------------
------------

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to