Keith,

thanks, here's an excerpt.  The schema is about 32 pages.  The L2000C segment is 
deeply embedded.

<xs:element name="L2000C" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="L2000C_HL">
<xs:complexType>
<xs:sequence>
<xs:element name="L2000C_HL01">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="12"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="L2000C_HL02" default="2">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="12"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="L2000C_HL03" fixed="22">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="L2000C_HL04" default="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>

I figure I needed to instantiate all the relevant classes first.  I use set or add 
methods for each of the higher level segments leading up to the L2000C_HL.  Here's the 
statement relating only to the "offending segment":

doc270.getData_270(0).getL2000A(0).getL2000B(0).getL2000C(0).setL2000C_HL(new 
L2000C_HL());

When I run the following debug, I see values in all fields, as shown below.
(sorry about the terrible tabbing)

if (isLoggingDebug())
                        {
                                logDebug("HL segment ");
                                logDebug("L2000C_HL " + 
doc270.getData_270(0).getL2000A(0).getL2000B(0).getL2000C(0).getL2000C_HL());
                                logDebug( "HL01 = " + 
doc270.getData_270(0).getL2000A(0).getL2000B(0).getL2000C(0).getL2000C_HL().getL2000C_HL01());
                                logDebug( "HL02 = " + 
doc270.getData_270(0).getL2000A(0).getL2000B(0).getL2000C(0).getL2000C_HL().getL2000C_HL02());
                                logDebug( "HL03 = " + 
doc270.getData_270(0).getL2000A(0).getL2000B(0).getL2000C(0).getL2000C_HL().getL2000C_HL03());
                                logDebug( "HL04 = " + 
doc270.getData_270(0).getL2000A(0).getL2000B(0).getL2000C(0).getL2000C_HL().getL2000C_HL04());
                        }

results:    
**** debug      Wed May 22 15:50:32 GMT-08:00 2002      1022111432889   
/ghc/eligibility/EligMgr        HL segment
**** debug      Wed May 22 15:50:32 GMT-08:00 2002      1022111432890   
/ghc/eligibility/EligMgr        L2000C_HL org.ghc.eli
gibility.L2000C_HL@c65e8
**** debug      Wed May 22 15:50:32 GMT-08:00 2002      1022111432892   
/ghc/eligibility/EligMgr        HL01 = 3
**** debug      Wed May 22 15:50:32 GMT-08:00 2002      1022111432893   
/ghc/eligibility/EligMgr        HL02 = 2
**** debug      Wed May 22 15:50:32 GMT-08:00 2002      1022111432894   
/ghc/eligibility/EligMgr        HL03 = 22
**** debug      Wed May 22 15:50:32 GMT-08:00 2002      1022111432895   
/ghc/eligibility/EligMgr        HL04 = 0
**** debug      Wed May 22 15:50:32 GMT-08:00 2002      1022111432896   
/ghc/eligibility/EligMgr        PREPARING TO VALIDATE

**** debug      Wed May 22 15:50:33 GMT-08:00 2002      1022111433894   
/ghc/eligibility/EligMgr        validation exception
L2000C_HL is a required field.

Hope that helps.  I'm leaving now but will attack this again tomorrow.

Thanks again.

Bernice

>>> [EMAIL PROTECTED] 05/22/02 04:50PM >>>

Bernice,

You have not provided enough information for us to help you. Can you
please provide the surrounding Schema for L2000C_HL? 

--Keith

Bernice Maslan wrote:
> 
> Hello,
> 
> I have a complicated schema for which I have used castor to generate classes.  I am 
>instantiating these classes and setting values.  I am ready to validate and marshal 
>my object.  The error message I keep getting is:
> 
> L2000C_HL is a required field.
> 
> I know it's a required field, I am instantiating it and providing values.  I put in 
>debug statements and I get values for the L2000C_HL segment and for the fields in it. 
> What gives?
> 
> I am using castor-0.9.3.9-xml.jar.
> 
> Thanks,
> 
> Bernice
> 
> -----------------------------------------------------------
> 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

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

Reply via email to