users@jaxb.java.net

Re: Can not unmarshall

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Mon, 27 Jul 2009 12:47:58 +0200

The user-profileType containes a <xs:sequence>, and each of its elements is
optional (minOccurs="0"). But it is ordered, so as soon as you actually have
one (e.g. "communication-types"), only those defined as following it are
accepted afterwards.

If elements may appear in any order, you may use <xs:all>; combining
<sequence><choice><element>... might be another option.

-W


On Mon, Jul 27, 2009 at 12:10 PM, Lulseged Zerfu <
lulseged.zerfu_at_ericsson.com> wrote:

> Hi
>
> I have a problem unmarshalling a document:
>
> It works when the communication-addresses attribute is at the top of the
> document.
>
> If it is else where in the document other then the top, it fails to
> unmarshall.
>
> The following is error reported:
>
> Source : 38.29: cvc-complex-type.2.4.a: Invalid content was found starting
> with element 'communication-addresses'. One of
> '{"urn:oma:xml:xdm:user-profile":hobbies,
> "urn:oma:xml:xdm:user-profile":favourite-links,
> WC[##other:"urn:oma:xml:xdm:user-profile"]}' is expected.
>
> <communication-addresses>
> <comm-addr>+1 858 623 0743</comm-addr>
> <comm-addr>asmith_at_omaorg.org</comm-addr>
> <comm-addr>sip:alice_at_example.com <sip%3Aalice_at_example.com></comm-addr>
> </communication-addresses>
>
> Is thi sa bug or is there anything wrong with the schema or the document?
>
> It should not matter where this attribute is located in the document.
>
> Thanks as always!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>