|
Re: XSD Importer and FeatureMap [message #1253685 is a reply to message #1253655] |
Sat, 22 February 2014 15:07 |
|
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 |
Alain Picard 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 |
Ed Merks 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/
|
|
|
Powered by
FUDForum. Page generated in 0.03423 seconds