users@jaxb.java.net

RE: Digest for list users_at_jaxb.java.net

From: Lulseged Zerfu <lulseged.zerfu_at_ericsson.com>
Date: Fri, 30 Nov 2012 07:29:38 +0000

Hi

 Turning of schema validation never produce any document.

 Moving types and elements as suggested results in the same error.

Can any one help me please.

BR
-Lulseged

-----Original Message-----
From: Wolfgang Laun [mailto:wolfgang.laun_at_gmail.com]
Sent: den 26 november 2012 12:55
To: users_at_jaxb.java.net
Subject: Re: Digest for list users_at_jaxb.java.net

Schema cai3g1.xsd announces that there is an element
   <Create/MOAttributes/CreateMODefinition>
in the namespace {http://schemas.ericsson.com/cai3g1.2}. But then this is set using a <{http://schemas.ericsson.com/mtas/mmtel/cai3g}createMMTel>.

You can do all sort of substitutions on the Java side since JAXBElement hides all incompatibilities. But the schema validation will detect this. (Turning off schema validation might give you a document, but I guess you don't want that.)

If you need free substitution at one point, including a change in the namespace, xs:any might be one way to go.

Another option would be to put the types and elements cited below into {http://schemas.ericsson.com/mtas/mmtel/cai3g}.

        <xs:complexType name="AbstractCreateAttributeType" abstract="true" />
        <xs:complexType name="AbstractGetRequestAttributeType" abstract="true" />
        <xs:complexType name="AbstractDeleteRequestAttributeType" abstract="true" />
        <xs:complexType name="AbstractSetAttributeType" abstract="true" />
        <xs:complexType name="AbstractGetAttributeType" abstract="true" />
        <xs:element name="CreateMODefinition"
type="AbstractCreateAttributeType" abstract="true" />
        <xs:element name="GetRequestMODefinition"
type="AbstractGetRequestAttributeType" abstract="true" />
        <xs:element name="DeleteRequestMODefinition"
type="AbstractDeleteRequestAttributeType" abstract="true" />
        <xs:element name="SetMODefinition" type="AbstractSetAttributeType"
abstract="true" />
        <xs:element name="GetMODefinition" type="AbstractGetAttributeType"
abstract="true" />

-W

On 26/11/2012, Lulseged Zerfu <lulseged.zerfu_at_ericsson.com> wrote:
> Hi
>
> Seems that I have filled in all children and their children. But it
> is always complaining about Invalid content:
>
> This happens both for Create and Set:
>
> All elements and their children are complete.
>
> cvc-complex-type.2.4.a: Invalid content was found starting with
> element 'mc:createMMTel'. One of
> '{"http://schemas.ericsson.com/cai3g1.2/":CreateMODefinition}' is expected.
> at line -1 column -1
>
>
> public Create createCreate(String moType, String id)
> {
> Create create = cai3gDocument.createCreate(moType);
>
> AnyMOIdType anyMOIdType = cai3gDocument.getFactory().createAnyMOIdType();
> anyMOIdType.getAny().add(factory.createPublicId(id));
> JAXBElement<AnyMOIdType> anyMOIdTypeElement =
> cai3gDocument.getFactory().createCreateMOId(anyMOIdType);
> create.setMOId(anyMOIdTypeElement);
>
> CreateMMTel mmtel = factory.createCreateMMTel();
>
> mmtel.setPublicIdentityAttribute(id);
>
>
> mmtel.setPublicIdentityElement(factory.createCreateMMTelPublicId(id));
>
> Create.MOAttributes attributes =
> cai3gDocument.getFactory().createCreateMOAttributes();
>
> attributes.setCreateMODefinition(factory.createCreateMMTel(mmtel));
>
>
> create.setMOAttributes(cai3gDocument.getFactory().createCreateMOAttrib
> utes(attributes));
>
> return create;
> }
>
> Or unmarshalling the following XML content results in the same error:
>
> cvc-complex-type.2.4.a: Invalid content was found starting with
> element 'mc:createMMTel'. One of
> '{"http://schemas.ericsson.com/cai3g1.2/":CreateMODefinition}' is expected.
> at line 12 column 52
>
> <cai3g:Create xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:cai3g="http://schemas.ericsson.com/cai3g1.2/"
> xmlns:mc="http://schemas.ericsson.com/mtas/mmtel/cai3g"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://schemas.ericsson.com/cai3g1.2/
> ../xsd/cai3g1.2.xsd http://schemas.ericsson.com/mtas/mmtel/cai3g
> ../xsd/mmtel-aggregated-service.xsd">
>
>
> <cai3g:MOType>MMTel@http://schemas.ericsson.com/mtas/mmtel/cai3g</cai3
> g:MOType>
>
> <cai3g:MOId>
> <mc:publicId>sip:user_at_ericsson.com</mc:publicId>
> </cai3g:MOId>
>
> <cai3g:MOAttributes>
> <mc:createMMTel publicId="sip:user_at_ericsson.com">
>
> <mc:publicId>sip:user_at_ericsson.com</mc:publicId>
>
> <mc:communication-diversion>
> <mc:cdiv-operator-configuration>
> <mc:cdiv-op-conditions>
> <mc:not-registered-condition>activated</mc:not-registered-condition>
> </mc:cdiv-op-conditions>
> </mc:cdiv-operator-configuration>
> <mc:cdiv-user-configuration>
> <mc:active>true</mc:active>
> <mc:cdiv-ruleset>
> <mc:cdiv-rule id="cfb">
> <mc:cdiv-conditions>
> <mc:cdiv-call-state>not-registered</mc:cdiv-call-state>
> </mc:cdiv-conditions>
> </mc:cdiv-rule>
> </mc:cdiv-ruleset>
> </mc:cdiv-user-configuration>
> </mc:communication-diversion>
>
> </mc:createMMTel>
> </cai3g:MOAttributes>
> </cai3g:Create>
>
>
> I wonder if this is a JAXB problem or not.
>
> Thank you for your help.
>
> BR
> Lulseged
>
> -----Original Message-----
> From: users-request_at_jaxb.java.net [mailto:users-request_at_jaxb.java.net]
> Sent: den 24 november 2012 01:33
> To: users_at_jaxb.java.net
> Subject: Digest for list users_at_jaxb.java.net
>
> Table of contents:
>
> 1. RE: Abstract - Lulseged Zerfu <lulseged.zerfu_at_ericsson.com> 2. XJC
> @XmlElement question - Markward Schubert <markward.schubert_at_gmail.com> 3.
> Re: Abstract - Wolfgang Laun <wolfgang.laun_at_gmail.com> 4. Re: XJC
> @XmlElement question - Wolfgang Laun <wolfgang.laun_at_gmail.com>
>
>