Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Does :choice behave properly
Does :choice behave properly [message #386113] Wed, 16 June 2004 08:13 Go to next message
jim is currently offline jim
Messages: 36
Registered: July 2009
Member
Ed-

The PrimativeValue xs:choice appears to cause all elements making up the
items of the complexType to be available for edit and saved as part of the
My.blah model Editor file.

I would have thought only one of them would be valid as part of the file.
Or at least flagged as invalid on next close/open.

My anyType reference allows that same behaviour (editing in a
PrimativeValue of all of these elements not just one). All of the elements
within the s:choice come up in the Properties window for edit.

<s:complexType name="PrimativeValue">
<s:choice>
<s:element name="Float" type="s:float">
</s:element>
<s:element name="Boolean" type="s:boolean">
</s:element>
<s:element name="Decimal" type="s:decimal">
</s:element>
<s:element name="Double" type="s:double">
</s:element>
<s:element name="HexBinary" type="s:hexBinary">
</s:element>
<s:element name="Duration" type="s:duration">
</s:element>
<s:element name="DateTime" type="s:dateTime">
</s:element>
<s:element name="Date" type="s:date">
</s:element>
<s:element name="AnyURI" type="s:anyURI">
</s:element>
<s:element name="String" type="s:string">
</s:element>
<s:element name="Notation" type="s:NOTATION">
</s:element>
<s:element name="Qname" type="s:QName">
</s:element>
</s:choice>
</s:complexType>
<s:complexType name="MyPrimativeType">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="myOPCPrimativeValue"
type="s0:PrimativeValue" />
</s:sequence>
</s:complexType>
Re: Does :choice behave properly [message #386118 is a reply to message #386113] Wed, 16 June 2004 08:41 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25227
Registered: July 2009
Senior Member
--------------E50A9FF724B2ADBA2A182166
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Jim,

Yes, a choice is modeled as a set of optional features and there is as yet no
enforcement of the mutual exclusiveness of the choices. In fact, we don't
even record the information about the exclusiveness yet. This bugzilla tracks
the issue:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=51210

jim wrote:

> Ed-
>
> The PrimativeValue xs:choice appears to cause all elements making up the
> items of the complexType to be available for edit and saved as part of the
> My.blah model Editor file.
>
> I would have thought only one of them would be valid as part of the file.
> Or at least flagged as invalid on next close/open.
>
> My anyType reference allows that same behaviour (editing in a
> PrimativeValue of all of these elements not just one). All of the elements
> within the s:choice come up in the Properties window for edit.
>
> <s:complexType name="PrimativeValue">
> <s:choice>
> <s:element name="Float" type="s:float">
> </s:element>
> <s:element name="Boolean" type="s:boolean">
> </s:element>
> <s:element name="Decimal" type="s:decimal">
> </s:element>
> <s:element name="Double" type="s:double">
> </s:element>
> <s:element name="HexBinary" type="s:hexBinary">
> </s:element>
> <s:element name="Duration" type="s:duration">
> </s:element>
> <s:element name="DateTime" type="s:dateTime">
> </s:element>
> <s:element name="Date" type="s:date">
> </s:element>
> <s:element name="AnyURI" type="s:anyURI">
> </s:element>
> <s:element name="String" type="s:string">
> </s:element>
> <s:element name="Notation" type="s:NOTATION">
> </s:element>
> <s:element name="Qname" type="s:QName">
> </s:element>
> </s:choice>
> </s:complexType>
> <s:complexType name="MyPrimativeType">
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="myOPCPrimativeValue"
> type="s0:PrimativeValue" />
> </s:sequence>
> </s:complexType>

--------------E50A9FF724B2ADBA2A182166
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Jim,
<p>Yes, a choice is modeled as a set of optional features and there is
as yet no enforcement of the mutual exclusiveness of the choices.&nbsp;
In fact, we don't even record the information about the exclusiveness yet.&nbsp;
This bugzilla tracks the issue:
<blockquote>&nbsp;<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=51210">https://bugs.eclipse.org/bugs/show_bug.cgi?id=51210</a></blockquote>

<p><br>jim wrote:
<blockquote TYPE=CITE>Ed-
<p>The PrimativeValue xs:choice appears to cause all elements making up
the
<br>items of the complexType to be available for edit and saved as part
of the
<br>My.blah model Editor file.
<p>I would have thought only one of them would be valid as part of the
file.
<br>Or at least flagged as invalid on next close/open.
<p>My anyType reference allows that same behaviour (editing in a
<br>PrimativeValue of all of these elements not just one). All of the elements
<br>within the s:choice come up in the Properties window for edit.
<p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;s:complexType name="PrimativeValue">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;s:choice>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;s:element name="Float" type="s:float">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/s:element>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;s:element name="Boolean" type="s:boolean">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/s:element>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;s:element name="Decimal" type="s:decimal">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/s:element>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;s:element name="Double" type="s:double">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/s:element>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;s:element name="HexBinary" type="s:hexBinary">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/s:element>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;s:element name="Duration" type="s:duration">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/s:element>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;s:element name="DateTime" type="s:dateTime">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/s:element>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;s:element name="Date" type="s:date">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/s:element>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;s:element name="AnyURI" type="s:anyURI">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/s:element>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;s:element name="String" type="s:string">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/s:element>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;s:element name="Notation" type="s:NOTATION">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/s:element>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;s:element name="Qname" type="s:QName">
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/s:element>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;/s:choice>
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &lt;/s:complexType>
<br>&lt;s:complexType name="MyPrimativeType">
<br>&lt;s:sequence>
<br>&lt;s:element minOccurs="0" maxOccurs="1" name="myOPCPrimativeValue"
<br>type="s0:PrimativeValue" />
<br>&lt;/s:sequence>
<br>&lt;/s:complexType></blockquote>
</html>

--------------E50A9FF724B2ADBA2A182166--
Previous Topic:EMF *.Editor minOccurs default display
Next Topic:need suggession
Goto Forum:
  


Current Time: Tue Oct 08 07:55:50 EDT 2013

Powered by FUDForum. Page generated in 0.06537 seconds