|Re: XSD->Ecore Mapping for unbounded sequences [message #1017831 is a reply to message #1017771]
||Tue, 12 March 2013 16:02
| Ed Merks
Registered: July 2009
On 12/03/2013 3:04 PM, Ronan B wrote:
> I'm pretty sure this issue has been brought up before but I can't see
> any resolution. I have created an ecore model based on an XSD. The XSD
> uses a sequence which has maxOccurs="unbounded" to state two elements
> can appear together an unlimited number of times within another
> element. They must sit together in this order. For example:
> <xs:element name="Range">
> <xs:sequence minOccurs="0" maxOccurs="unbounded">
> <xs:element ref="min"/>
> <xs:element ref="max"/>
> However, this restriction seems to be lost upon converting to ecore as
> my out models have the min and max elements stuck together e.g.
> How can I give the ecore serializer a hint not to do this to my XML?
You'd need to add an annotation to the schema, i.e., add
ecore:featureMap="rangeElements", so that a feature map that records the
mixed order of the two different "min"/"max" features.
> I found a similar issue on the boards on in this link,
> (see section Multiplicity at the Sequence or Choice Level)
> I know I could fix the original schema to avoid this issue but I don't
> have this possibility open to me.
It can't be done without at least add an annotation...
> Any help is appreciated!
Powered by FUDForum
. Page generated in 0.02150 seconds