Scott,
 
I'm not quite sure what you mean by posting an example. The schema in my original message was extracted (and simplified) from the schema I have to handle. Do you perhaps mean the classes generated by Castor from the schema?
 
Paul
----- Original Message -----
Sent: Wednesday, July 03, 2002 7:51 PM
Subject: Re: [castor-dev] Problems With Source Code Generation

Hi Paul,
 
Could you post an XML example of what is returned. I am working on something that I think may work for your situation where unimplemented types are returned. (I am specifically interested in seeing what the union is going to look like in the xml).
 
Kind regards
Scott.
 
 
----- Original Message -----
Sent: Tuesday, July 02, 2002 1:13 AM
Subject: Re: [castor-dev] Problems With Source Code Generation

Thanks Scott, I will look into why my generation throws an exception.
 
On the issue of unsupported features. The system I am building interfaces to another system via XML and the XML schema are dictated by the other system. I have no opportunity to modify the schema to those supported by Castor. Is there is recommended approach when faced with this problem.
 
Paul
----- Original Message -----
Sent: Tuesday, July 02, 2002 6:49 PM
Subject: Re: [castor-dev] Problems With Source Code Generation

Hi Paul,
 
I am running version 0.9.3.19 and I have no trouble generating classes from your first schema.  See attached .zip for classes generated from first schema.
 
With regards to your second schema you will notice that the stack trace informs you that the Data Type union is not yet supported. This is why your simple type LevelOrVFR which contains a union of memberTypes="Level VFR" is not created.
 
[Stack Trace]
-- Suppressing non fatal warnings.
org.xml.sax.SAXException: 'union' elements are not yet supported.
   line: 21 at org.exolab.castor.xml.schema.reader.SaxUnmarshaller.error(SaxUnmarshaller.java:169)
 
Kind regards
Scott.
----- Original Message -----
Sent: Monday, July 01, 2002 11:56 PM
Subject: [castor-dev] Problems With Source Code Generation

Hi,
 
I have a couple of problems with source code generation. Using version 0.9.3.19.
 
1 - The following schema throws an exception during source generation.
 
Schema:
 
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
 <xs:complexType name="Field19">
  <xs:sequence>
   <xs:element name="c" minOccurs="0">
    <xs:simpleType>
     <xs:list itemType="EmergRadioEquip"/>
    </xs:simpleType>
   </xs:element>
  </xs:sequence>
 </xs:complexType>
 <xs:simpleType name="EmergRadioEquip">
  <xs:restriction base="xs:string">
   <xs:enumeration value="U"/>
   <xs:enumeration value="V"/>
   <xs:enumeration value="E"/>
  </xs:restriction>
 </xs:simpleType>
</xs:schema>
 
Exception:
 
Exception in thread "main" java.lang.IllegalArgumentException: 'null' is n
        at org.exolab.javasource.JClass.<init>(Unknown Source)
        at org.exolab.castor.builder.TypeConversion.convertType(Unknown So
        at org.exolab.castor.builder.MemberFactory.createFieldInfo(Unknown
        at org.exolab.castor.builder.SourceFactory.processContentModel(Unk
        at org.exolab.castor.builder.SourceFactory.processContentModel(Unk
        at org.exolab.castor.builder.SourceFactory.processComplexType(Unkn
        at org.exolab.castor.builder.SourceFactory.createSourceCode(Unknow
        at org.exolab.castor.builder.SourceGenerator.processComplexType(Un
        at org.exolab.castor.builder.SourceGenerator.createClasses(Unknown
        at org.exolab.castor.builder.SourceGenerator.generateSource(Unknow
        at org.exolab.castor.builder.SourceGenerator.generateSource(Unknow
        at org.exolab.castor.builder.SourceGenerator.generateSource(Unknow
        at org.exolab.castor.builder.SourceGenerator.main(Unknown Source)
 
 
2 - The following schema generates classes for 'Test' and 'VFR' but not 'Level' and 'LevelOrVFR'. No error is reported during generation. javaclassmapping=type.
 
Compilation fails because class 'Test' has references to the non-existent class 'LevelOrVFR'.
 
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
 <xs:complexType name="Test">
  <xs:sequence>
   <xs:element name="level" type="LevelOrVFR"/>
  </xs:sequence>
 </xs:complexType>
 <xs:simpleType name="Level">
  <xs:restriction base="xs:string">
   <xs:pattern value="(A|F)[0-9]{3}"/>
   <xs:pattern value="(S|M)[0-9]{4}"/>
  </xs:restriction>
 </xs:simpleType>
 <xs:simpleType name="VFR">
  <xs:restriction base="xs:string">
   <xs:enumeration value="VFR"/>
  </xs:restriction>
 </xs:simpleType>
 <xs:simpleType name="LevelOrVFR">
  <xs:union memberTypes="Level VFR"/>
 </xs:simpleType>
</xs:schema>
 
Thanks,
Paul

Reply via email to