users@jaxb.java.net

Re: SubstitutionGroup and inheritance

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Wed, 19 Dec 2012 09:48:15 -0500

We migrated schenmas for ebXML RegRep standard from element to type
substitution between version 3 and 4.
Compare the type hierarchy for RegistryObject / RegistryObjectType
between version 3 and 4 to get an idea.

  * rim.xsd version 3
    <http://docs.oasis-open.org/regrep/v3.0/schema/rim.xsd> with element
    substitution
  * rim.xsd version 4
    <http://docs.oasis-open.org/regrep/regrep-core/v4.0/os/xsd/rim.xsd>
    with element substitution replaced with type substitution


Noet that you will not be able to just do a diff as there are many other
changes.

Take a look at how the following type hierarchy are modeled in both:

  * IdentifiableType
      o RegistryObjectType
          + AssociationType

If you have specific questions after seeing this example and reading
about type substitution then I can try and help.

Good luck.


On 12/15/2012 03:11 AM, Lulseged Zerfu wrote:
> Hi
> Thanks.
> How should it look like?
> BR
> Lulseged
>
> ------------------------------------------------------------------------
> *From:* Farrukh Najmi [mailto:farrukh_at_wellfleetsoftware.com]
> *Sent:* den 14 december 2012 17:58
> *To:* users_at_jaxb.java.net
> *Subject:* Re: SubstitutionGroup and inheritance
>
>
> This may be off-topic but if my experience is that Type Substitution
> in schema instead of Element substitution (aka Subsitution Group)
> works much better with JAXB and other binding tools. If you have
> control over the schema then consider replacing Subsitution Groups
> with Type Substitution in schema.
>
> On 12/14/2012 05:03 AM, Lulseged Zerfu wrote:
>>
>> Hi
>>
>> Thanks for your support.
>>
>> I have changed to java 6 and get same problem.
>>
>> JAXB expects CreateMODefinition, CreateMODefinition is abstract and
>> should not be expected, right?
>>
>> 2012-12-14 10:40:18,308 ERROR
>> [com.ericsson.ims.mtas.xdms.common.binder.GenericBinder 169] -
>> <cvc-complex-type.2.4.a: Invalid content was found starting with
>> element 'createMMTel'. One of
>> '{"http://schemas.ericsson.com/cai3g1.2/":CreateMODefinition}' is
>> expected. at line 13 column 49>
>>
>> [_org.xml.sax.SAXParseException_: cvc-complex-type.2.4.a: Invalid
>> content was found starting with element 'createMMTel'. One of
>> '{"http://schemas.ericsson.com/cai3g1.2/":CreateMODefinition}' is
>> expected.]
>>
>> I am trying to unmarshall service.xml which is valid document´. I get
>> same problem when marshalling as well.
>>
>> How should it look like if it is not valid?
>>
>> Do you see any problem in the schemas?
>>
>> Is this a JAXB problem?
>>
>> createMMTel is of type AbstractCreateAttributeType
>>
>> BR
>> Lulseged
>> ------------------------------------------------------------------------
>> *From:* Mikhail Balanov [mailto:realsonic3_at_gmail.com]
>> *Sent:* den 7 december 2012 08:40
>> *To:* users_at_jaxb.java.net
>> *Subject:* Re: SubstitutionGroup and inheritance
>>
>> Hello Lulseged,
>>
>> Can you provide stack trace?
>>
>> I've come accross an NPE when I worked with Java 7, but my code is
>> working in Java 6 fine.
>>
>>
>> On 7 December 2012 11:23, Lulseged Zerfu <lulseged.zerfu_at_ericsson.com
>> <mailto:lulseged.zerfu_at_ericsson.com>> wrote:
>>
>> Hi
>> I have tried all my best to use JAXB and am not able to fix my
>> problem.
>> My question is if JAXB supports inheritance or not.
>> The code generated by JAXB from a schema looks correct. But
>> marshalling and unmarshalling results always in an exception.
>> BR
>> Lulseged
>>
>>
>
>
> --
> Regards,
> Farrukh Najmi
>
> Web:http://www.wellfleetsoftware.com
>


-- 
Regards,
Farrukh Najmi
Web: http://www.wellfleetsoftware.com