Hi.
  Your XSD file is ok. You must add this line
"org.exolab.castor.builder.javaclassmapping=type" to your
castorbuilder.properties. This file must be in your classpath. There is one
in the castor proyect.
  And the file is name castorbuilder.properties, NOT castor.properties
  I spent a week with it!


______________________________________________
Ing. Gustavo Rafael Pistoia
CDA Inform�tica S.A.
TE: 4343-5200.
Int (6329) 4566.


                                                                                       
                            
                    "Dunn, Scott"                                                      
                            
                    <SDunn@sonusn        Para:   [EMAIL PROTECTED]                 
                            
                    et.com>              cc:                                           
                            
                                         Asunto:      [castor-dev] Castor bug or 
limitation?                       
                    15-02-02                                                           
                            
                    03:56 PM                                                           
                            
                    Por favor,                                                         
                            
                    responda a                                                         
                            
                    castor-dev                                                         
                            
                                                                                       
                            
                                                                                       
                            



I apologise if this is a known problem, but I was unable to figure how to
characterise this in order to search the mail archives.

I am trying to do something like the following:

 <xsd:complexType name="PurchaseOrderType">
  <xsd:sequence>
   <xsd:element name="shipTo" type="USAddress"/>
   <xsd:element name="billTo" type="USAddress"/>
  </xsd:sequence>
 </xsd:complexType>

Where a complexType contains two elements of the same type.  I expected
that
the generated Java source would look like:

public class PurchaseOrderType {

  USAddress _shipTo;
  USAddress _billTo;
  ...
}

Instead it looks like:

public class PurchaseOrderType {

  ShipTo _shipTo;
  BillTo _billTo;
  ...
}

There is no definition for a ShipTo or BillTo type anywhere in my schema so
the type field seems to be pretty much ignored.

The XML Primer (http://www.w3.org/TR/xmlschema-0/#po.xsd) contains a
complete schema that demonstrates this problem. Is this a known or
acknowledged problem and is there a fix planned or available?

The Castor Source Code Generator User Document does imply that the schema
above should work as I interpret it.  The following extract from the doc
suggests that the 'type' field of the <element> does actually get used when
generating the setter.

<complexType>
  <element name="products" type="product" minOccurs="0" maxOccurs=
"unbounded">
</complexType>

public void setProducts(Product[] productArray) {

}

Thanks,

Scott.

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

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

Reply via email to