Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XSD -> EMF mixed + choice group
XSD -> EMF mixed + choice group [message #653230] Tue, 08 February 2011 22:00 Go to next message
John T.E. Timm is currently offline John T.E. TimmFriend
Messages: 160
Registered: July 2009
Senior Member
I have an XML Schema with a rather complex datatype:

<xsd:complexType name="MyType" mixed="true">
  <xsd:sequence>
    <xsd:choice minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="element1" type="Type1"/>
      <xsd:element name="element2" type="Type2"/>
      <xsd:element name="element3" type="Type3"/>
    </xsd:choice>
    <xsd:element name="someOtherElement" type="SomeOtherType"/>
  </xsd:seqeuence>
</xsd:complexType>


NOTE: Type1, Type2 and Type3 are also "mixed"

Importing this into EMF, a feature map named "group" is created to manage the choice group and another feature map named "mixed" is used to manage mixed content. Features element1, element2 and element3 are "derived" from the "group" feature map. The "group" feature map is "derived" from the "mixed" feature map and finally someOtherElement is "derived" from the "mixed" feature map. Now, the problem I am having is that when I programmatically construct an instance, "someOtherElement" should always occur after any other feature (regardless of when it is added (before or after other features) but this order is not honored. Any ideas on how to make this work properly?

Thanks,

JT
Re: XSD -> EMF mixed + choice group [message #653242 is a reply to message #653230] Wed, 09 February 2011 00:15 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30546
Registered: July 2009
Senior Member
John,

Comments below.

John T. wrote:
> I have an XML Schema with a rather complex datatype:
>
>
> <xsd:complexType name="MyType" mixed="true">
> <xsd:sequence>
> <xsd:choice minOccurs="0" maxOccurs="unbounded">
> <xsd:element name="element1" type="Type1"/>
> <xsd:element name="element2" type="Type2"/>
> <xsd:element name="element3" type="Type3"/>
> </xsd:choice>
> <xsd:element name="someOtherElement" type="SomeOtherType"/>
> </xsd:seqeuence>
> </xsd:complexType>
>
>
> NOTE: Type1, Type2 and Type3 are also "mixed"
>
> Importing this into EMF, a feature map named "group" is created to
> manage the choice group and another feature map named "mixed" is used
> to manage mixed content. Features element1, element2 and element3 are
> "derived" from the "group" feature map. The "group" feature map is
> "derived" from the "mixed" feature map and finally someOtherElement is
> "derived" from the "mixed" feature map. Now, the problem I am having
> is that when I programmatically construct an instance,
> "someOtherElement" should always occur after any other feature
> (regardless of when it is added (before or after other features) but
> this order is not honored. Any ideas on how to make this work properly?
You'll have to add it to the appropriate position in the feature map
yourself (or set that feature after populating element1-3 first).
>
> Thanks,
>
> JT
Previous Topic:Save GMF and EMF in different datastores (TENEO)
Next Topic:[CDO] Has moved from CVS to SVN !!!
Goto Forum:
  


Current Time: Wed Oct 16 10:08:09 GMT 2019

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

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

Back to the top