Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Ecore lower/upper bounds don't match XSD schema
Ecore lower/upper bounds don't match XSD schema [message #419247] Wed, 14 May 2008 15:56 Go to next message
Greg Wilson is currently offline Greg WilsonFriend
Messages: 7
Registered: July 2009
Junior Member
I'm using EMF 2.3.2 and generating a model from an XSD schema. Here's a
portion of the schema:

<xsd:element name="uiLayout" type="uiLayoutType"/>
<xsd:complexType name="uiLayoutType">
<xsd:choice maxOccurs="unbounded">
<xsd:element name="container" type="containerType" minOccurs="1"
maxOccurs="1"/>
<xsd:element name="allowedValues" type="allowedValuesType"
minOccurs="0" maxOccurs="unbounded"/>
</xsd:choice>
<xsd:attribute name="displayName" type="xsd:string" use="required"/>
</xsd:complexType>

The Ecore model for UiLayoutType->container is generated with a Lower Bound
of "0" and an Upper Bound of "-1". I can manually correct it to "1" and "1",
I'm wondering why it's being generated this way. Do I need to change
something in the schema?

Thanks,
Greg
Re: Ecore lower/upper bounds don't match XSD schema [message #419249 is a reply to message #419247] Wed, 14 May 2008 17:01 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Greg,

Comments below.

Greg Wilson wrote:
> I'm using EMF 2.3.2 and generating a model from an XSD schema. Here's a
> portion of the schema:
>
> <xsd:element name="uiLayout" type="uiLayoutType"/>
> <xsd:complexType name="uiLayoutType">
> <xsd:choice maxOccurs="unbounded">
> <xsd:element name="container" type="containerType" minOccurs="1"
> maxOccurs="1"/>
> <xsd:element name="allowedValues" type="allowedValuesType"
> minOccurs="0" maxOccurs="unbounded"/>
> </xsd:choice>
> <xsd:attribute name="displayName" type="xsd:string" use="required"/>
> </xsd:complexType>
>
> The Ecore model for UiLayoutType->container is generated with a Lower Bound
> of "0" and an Upper Bound of "-1". I can manually correct it to "1" and "1",
> I'm wondering why it's being generated this way. Do I need to change
> something in the schema?
>
The schema itself has a choice which is unbounded, so ultimately an
unbounded number of "container" and "allowedValues" can appear. The
upper bound on a feature is computed by multiplying the bounds of the
element itself and of each containing model group. Since each
individual possible choice might be omitted, the lower bound on children
of a choice are zero.
> Thanks,
> Greg
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Ecore lower/upper bounds don't match XSD schema [message #419252 is a reply to message #419249] Wed, 14 May 2008 20:18 Go to previous message
Greg Wilson is currently offline Greg WilsonFriend
Messages: 7
Registered: July 2009
Junior Member
Thanks for the clarification, Ed. I changed the
<xsd:choice maxOccurs="unbounded">
to
<xsd:sequence>
and it's generating as I hoped.

Greg

"Ed Merks" <merks@ca.ibm.com> wrote in message
news:g0f5t4$c37$1@build.eclipse.org...
> Greg,
>
> Comments below.
>
> Greg Wilson wrote:
>> I'm using EMF 2.3.2 and generating a model from an XSD schema. Here's a
>> portion of the schema:
>>
>> <xsd:element name="uiLayout" type="uiLayoutType"/>
>> <xsd:complexType name="uiLayoutType">
>> <xsd:choice maxOccurs="unbounded">
>> <xsd:element name="container" type="containerType" minOccurs="1"
>> maxOccurs="1"/>
>> <xsd:element name="allowedValues" type="allowedValuesType"
>> minOccurs="0" maxOccurs="unbounded"/>
>> </xsd:choice>
>> <xsd:attribute name="displayName" type="xsd:string" use="required"/>
>> </xsd:complexType>
>>
>> The Ecore model for UiLayoutType->container is generated with a Lower
>> Bound of "0" and an Upper Bound of "-1". I can manually correct it to "1"
>> and "1", I'm wondering why it's being generated this way. Do I need to
>> change something in the schema?
>>
> The schema itself has a choice which is unbounded, so ultimately an
> unbounded number of "container" and "allowedValues" can appear. The upper
> bound on a feature is computed by multiplying the bounds of the element
> itself and of each containing model group. Since each individual possible
> choice might be omitted, the lower bound on children of a choice are zero.
>> Thanks,
>> Greg
>>
>>
Previous Topic:AffectedObjects in mostRecentCommand is always empty!
Next Topic:Re-setting a property depending on another property
Goto Forum:
  


Current Time: Fri Apr 26 07:58:56 GMT 2024

Powered by FUDForum. Page generated in 0.03295 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top