xs:choice and inheritance [message #420926] |
Wed, 16 July 2008 15:21 |
Eclipse User |
|
|
|
Originally posted by: erwann.poupart.cnes.fr
It seems that xs:choice is handled in the same way that xs:sequence when
importing an XMLSchema to buil a new EMF model ?
It's a problem when this xs:choice semantic means an exclusive or, i
expected it to be translated into inheritance but this is not the case.
is there an explanation, is it a bug ?
If not, Is there a solution modifying my XML-Schema ?
the XML-Schema used can be found below :
http://www.omg.org/cgi-bin/doc?space/2006-4-4
Thank you for any help,
Best regards,
Erwann.
|
|
|
Re: xs:choice and inheritance [message #420931 is a reply to message #420926] |
Wed, 16 July 2008 16:07 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Erwann,
Comments below.
poupart wrote:
>
> It seems that xs:choice is handled in the same way that xs:sequence
> when importing an XMLSchema to buil a new EMF model ?
Yes, it's our oldest bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=51210
>
> It's a problem when this xs:choice semantic means an exclusive or, i
> expected it to be translated into inheritance but this is not the case.
The problem is that the exclusiveness is not recorded and hence not
validated.
>
> is there an explanation, is it a bug ?
It's just something that never been supported and is a lot of work to
support.
>
> If not, Is there a solution modifying my XML-Schema ?
Don't use choice. :-P
>
> the XML-Schema used can be found below :
> http://www.omg.org/cgi-bin/doc?space/2006-4-4
If enforcement of the mutual exclusion is important, I'd add a named
constraint to the complex type (ecore:constraints="blah") and implement
the check by hand in the generated validator.
>
> Thank you for any help,
>
> Best regards,
>
> Erwann.
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02866 seconds