Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Xsd derivated schema customization - how to avoiding unnecesary/useless list wrappers derivated from
Xsd derivated schema customization - how to avoiding unnecesary/useless list wrappers derivated from [message #508006] Fri, 15 January 2010 14:42 Go to next message
Eclipse UserFriend
Originally posted by: murbieta.gpi.com.ar

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).

It seems that there is a patch but i'd like to make it work with an
standard solution. Patch is available at:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=201662


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.

regards
Re: Xsd derivated schema customization - how to avoiding unnecesary/useless list wrappers derivated [message #508066 is a reply to message #508006] Fri, 15 January 2010 18:16 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Matias,

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).
>
> It seems that there is a patch but i'd like to make it work with an
> standard solution. Patch is available at:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=201662
Yes, I mentioned that in your mailing list posting.
>
>
> 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.
The customization of the serialization/deserialization is what those
patches are about.
>
>
> 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.
Unfortunately I've only gotten as far as the patches in that bugzilla
and my time is limited.
>
> regards


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Editor for Multiple XML Files
Next Topic:filling URI property on a EMF model
Goto Forum:
  


Current Time: Thu Apr 18 20:20:01 GMT 2024

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

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

Back to the top