Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XSD Importer and FeatureMap
XSD Importer and FeatureMap [message #1253655] Sat, 22 February 2014 14:20 Go to next message
Alain Picard is currently offline Alain PicardFriend
Messages: 266
Registered: July 2009
Senior Member
I am importing an XSD from a 3rd party and it is generating FeatureMap
groups where I believe there shouldn't be any.

I have been able to identify such a case, where I can't understand the
use of the map.

The following creates a FeatureMap;
<xs:complexType name="entitiesType">
<xs:sequence maxOccurs="unbounded">
<xs:element name="entity" type="entityType"/>
</xs:sequence>
</xs:complexType>

And this revised version doesn't:
<xs:complexType name="entitiesType">
<xs:sequence>
<xs:element name="entity" type="entityType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

My research on specifying min/max occurs on the sequence vs the element
is that it should normally be on the element but I can't understand
where that impacts FeatureMaps.

Thanks
Alain
Re: XSD Importer and FeatureMap [message #1253685 is a reply to message #1253655] Sat, 22 February 2014 15:07 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

Hi, Alain,

A sequence can potentially declare any number of elements, not just
one. So, repeating that sequence implies (potential) interleaving of
different elements, which in EMF requires a FeatureMap for correct
serialization. I think you just have a special case (single element in
the sequence) of this more general scenario.

HTH,

Christian

On 2014-02-22 14:20:44 +0000, Alain Picard said:

> I am importing an XSD from a 3rd party and it is generating FeatureMap
> groups where I believe there shouldn't be any.
>
> I have been able to identify such a case, where I can't understand the
> use of the map.
>
> The following creates a FeatureMap;
> <xs:complexType name="entitiesType">
> <xs:sequence maxOccurs="unbounded">
> <xs:element name="entity" type="entityType"/>
> </xs:sequence>
> </xs:complexType>
>
> And this revised version doesn't:
> <xs:complexType name="entitiesType">
> <xs:sequence>
> <xs:element name="entity" type="entityType" maxOccurs="unbounded"/>
> </xs:sequence>
> </xs:complexType>
>
> My research on specifying min/max occurs on the sequence vs the element
> is that it should normally be on the element but I can't understand
> where that impacts FeatureMaps.
>
> Thanks
> Alain
Re: XSD Importer and FeatureMap [message #1253766 is a reply to message #1253685] Sat, 22 February 2014 17:17 Go to previous messageGo to next message
Alain Picard is currently offline Alain PicardFriend
Messages: 266
Registered: July 2009
Senior Member
Thanks Christian for the quick reply.

Alain

On 2/22/2014 10:07 AM, Christian W. Damus wrote:
> Hi, Alain,
>
> A sequence can potentially declare any number of elements, not just
> one. So, repeating that sequence implies (potential) interleaving of
> different elements, which in EMF requires a FeatureMap for correct
> serialization. I think you just have a special case (single element in
> the sequence) of this more general scenario.
>
> HTH,
>
> Christian
>
> On 2014-02-22 14:20:44 +0000, Alain Picard said:
>
>> I am importing an XSD from a 3rd party and it is generating FeatureMap
>> groups where I believe there shouldn't be any.
>>
>> I have been able to identify such a case, where I can't understand the
>> use of the map.
>>
>> The following creates a FeatureMap;
>> <xs:complexType name="entitiesType">
>> <xs:sequence maxOccurs="unbounded">
>> <xs:element name="entity" type="entityType"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>> And this revised version doesn't:
>> <xs:complexType name="entitiesType">
>> <xs:sequence>
>> <xs:element name="entity" type="entityType" maxOccurs="unbounded"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>> My research on specifying min/max occurs on the sequence vs the
>> element is that it should normally be on the element but I can't
>> understand where that impacts FeatureMaps.
>>
>> Thanks
>> Alain
>
>
Re: XSD Importer and FeatureMap [message #1254399 is a reply to message #1253766] Sun, 23 February 2014 10:21 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Alain,

Yes, it's exactly as Christian hypothesized. Repeating model groups do
in general lead to feature maps because of element interleaving. This
special case of a model group with only one particle I suppose could be
handled in a special way. Adding ecore:featureMap="" to the
xs:sequence would suppress it explicitly...


On 22/02/2014 6:17 PM, Alain Picard wrote:
> Thanks Christian for the quick reply.
>
> Alain
>
> On 2/22/2014 10:07 AM, Christian W. Damus wrote:
>> Hi, Alain,
>>
>> A sequence can potentially declare any number of elements, not just
>> one. So, repeating that sequence implies (potential) interleaving of
>> different elements, which in EMF requires a FeatureMap for correct
>> serialization. I think you just have a special case (single element in
>> the sequence) of this more general scenario.
>>
>> HTH,
>>
>> Christian
>>
>> On 2014-02-22 14:20:44 +0000, Alain Picard said:
>>
>>> I am importing an XSD from a 3rd party and it is generating FeatureMap
>>> groups where I believe there shouldn't be any.
>>>
>>> I have been able to identify such a case, where I can't understand the
>>> use of the map.
>>>
>>> The following creates a FeatureMap;
>>> <xs:complexType name="entitiesType">
>>> <xs:sequence maxOccurs="unbounded">
>>> <xs:element name="entity" type="entityType"/>
>>> </xs:sequence>
>>> </xs:complexType>
>>>
>>> And this revised version doesn't:
>>> <xs:complexType name="entitiesType">
>>> <xs:sequence>
>>> <xs:element name="entity" type="entityType"
>>> maxOccurs="unbounded"/>
>>> </xs:sequence>
>>> </xs:complexType>
>>>
>>> My research on specifying min/max occurs on the sequence vs the
>>> element is that it should normally be on the element but I can't
>>> understand where that impacts FeatureMaps.
>>>
>>> Thanks
>>> Alain
>>
>>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EMF Compare FeatureNotFoundException
Next Topic:Storing a FeaturePath
Goto Forum:
  


Current Time: Thu Apr 25 18:09:44 GMT 2024

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

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

Back to the top