Unfortunately, if the element itself is abstract in Schema, you have to
use substitution groups. So the only way to get out of this is for you
to use XmlCursor to change the name of the offending element before you
send it out.
 
Radu


________________________________

        From: Christopher Hunt [mailto:[EMAIL PROTECTED] 
        Sent: Friday, June 06, 2008 5:12 AM
        To: [email protected]
        Subject: Abstract element with concrete type problem
        
        
        Hi there, 

        I'm not sure if this is an xmlbeans issue, or an issue with the
xml validator I'm using...

        I've produced an XML (GML) document which I validate with Java
1.5's SchemaFactory for a junit test case. The test case fails and
declares:

         The value of {abstract} in the element declaration for
'ns1:AbstractTimeSlice' must be false.

        Here's the xml:

         <AbstractTimeSlice xsi:type="ns:JourneyStatusType" ns1:id="a1">

        (I can't use substitution groups because the JourneyStatusType
is in a different jar to the AbstractTimeSlice...)

        Here's the code I use to construct the timeslice:

         AbstractTimeSliceType abstractTimeSliceType = 
          historyPropertyType
           .addNewAbstractTimeSlice();

         JourneyStatusType journeyStatusType = 
          (JourneyStatusType) abstractTimeSliceType
           .changeType(JourneyStatusType.type);
        
        
        Thanks for any help.

        Cheers,
        -C


Notice:  This email message, together with any attachments, may contain 
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated 
entities,  that may be confidential,  proprietary,  copyrighted  and/or legally 
privileged, and is intended solely for the use of the individual or entity 
named in this message. If you are not the intended recipient, and have received 
this message in error, please immediately return this by email and then delete 
it.

Reply via email to