Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [emf-dev] Xsd derivated schema customization - how to avoiding unnecesary list wrappers derivated from complextype

Matias,

Please use the newsgroup/forum for asking questions.
news://new.eclipse.org/eclipse.tools.emf
More comments below.


Matias Urbieta wrote:
Hi i'm generating an ecore model from a xsd. The schema defines
sequences of elements within complextypes that later are translated as
eclasses working as list "wrappers".
When i try to use this model with GMF, list wrapper are not well
received (gmf can't handle it).

So i'd need to derivate an ecore model avoiding generating list
"wrappers" when a complexType followed by a sequence is found. Or in the
other way around,i would need to customize emf
serialization/deserialization for working with wrapped list.

Next, i'll present the  case: 

My xsd specifies the following  schema :

  <xs:element name="step">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="external-permissions" minOccurs="0" />
        <xs:element ref="actions" minOccurs="0" />
      </xs:sequence>
      <xs:attribute name="name" type="xs:string" use="required" />
      <xs:attribute name="id" type="xs:string" use="required" />
    </xs:complexType>
  </xs:element>

  <xs:element name="steps">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="step" maxOccurs="unbounded" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
 
 <xs:element name="workflow">
    <xs:complexType>
      <xs:sequence>
        ..        
        <xs:element ref="steps" />
        ...
      </xs:sequence>
    </xs:complexType>
  </xs:element>

This schema allows specifying an xml like

<workflow>
<steps>
<step id=.../>
...
</steps>
</workflow>

When i derivate this schema to EMF, three Eclasses are created
WorkflowType, StepsType and StepType. The first have a reference to a
StepsType instance and this last has a list to StepType instances.Here,
the StepsType works as a decorator for the stepType list.

Here i'd need to avoid generating the StepsType Eclass.
  
Someone else was asking this same type of question recently.  It relates to https://bugs.eclipse.org/bugs/show_bug.cgi?id=201662 which we've not found time to complete.
regards
  




_______________________________________________
emf-dev mailing list
emf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/emf-dev
  

Back to the top