Kelvin,

can you please raise a new Jira issue and attach a minimal set of files
to the issue (i.e. the most minimal XML schema, XML input document to
reproduce the ValidationException, custom builder properties in case you
are overriding default, Ant tasks or Maven plugin configuration, etc.)

Having said that; i have worked with a rather biggish customer of mine
(through professional services) about one year ago to allow them to use
Castor XML with the FpML 4.2 standard, and I am very surprised to see
you having problems like this.But as said, I will need a working test
case that allows me to replay the problem you are facing.

Regards
Werner

Kelvin Yip wrote:
> Hi
> 
> I am using fpml version 4.3 schema and it has a base class reference
> Product in it like this: <xsd:element ref="product" /> Product is
> actually a base class and it is generated properly using Castor
> source code generation. The derived class could be swap, fra....., I
> checked the classes and descriptors and the classes look correct.
> However, when I give it an xml file, the validation fails and says
> 
> org.exolab.castor.xml.MarshalException: The following exception
> occured while validating field: _trade of class: com.calypso.casto 
> r.SD.fpml43.RequestTradeConfirmation: The field '_product' (whose xml
> name is 'product') is a required field of class 'com. 
> .castor.SD.fpml43.Trade{File: [not available]; line: 112; column: 8}
> 
> It looks like the code is correct but the validation does not know
> how to interpret product and treat <product> as a real tag rather
> than a base class which can have subclass values during run time.
> 
> 
> Any idea how I can solve this problem ? I turned off the validation
> but product will be null.
> 
> 
> 
> 
> Schema below********************************************
> 
> 
> 
> 
> 
> <xsd:complexType name="Trade"> <xsd:annotation> <xsd:documentation
> xml:lang="en">A type defining an FpML trade.</xsd:documentation> 
> </xsd:annotation> <xsd:sequence> <xsd:element name="tradeHeader"
> type="TradeHeader"> <xsd:annotation> <xsd:documentation
> xml:lang="en">The information on the trade which is not product
> specific, e.g. trade date.</xsd:documentation> </xsd:annotation> 
> </xsd:element> <xsd:element ref="product" /> <xsd:element
> name="otherPartyPayment" type="Payment" minOccurs="0"
> maxOccurs="unbounded"> <xsd:annotation> <xsd:documentation
> xml:lang="en">Other fees or additional payments associated with the
> trade, e.g. broker commissions, where one or more of the parties
> involved are not principal parties involved in the
> trade.</xsd:documentation> </xsd:annotation> </xsd:element> 
> <xsd:element name="brokerPartyReference" type="PartyReference"
> minOccurs="0" maxOccurs="unbounded"> <xsd:annotation> 
> <xsd:documentation xml:lang="en">Identifies that party (or parties)
> that brokered this trade.</xsd:documentation> </xsd:annotation> 
> </xsd:element>
> 
> 

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to