Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » xs:any as EList<EObject>
xs:any as EList<EObject> [message #418244] Tue, 08 April 2008 13:58 Go to next message
Jeffrey Ricker is currently offline Jeffrey RickerFriend
Messages: 18
Registered: July 2009
Junior Member
Is it possible to avoid feature maps and get xs:any as a list of EObject?

Take the SOAP schema, for instance.

<xs:complexType name="Body" >
<xs:sequence>
<xs:any namespace="##any" processContents="lax" minOccurs="0"
maxOccurs="unbounded" ecore:instanceClass="EObject" ecore:name="elements"/>
</xs:sequence>
<xs:anyAttribute namespace="##other" processContents="lax"
ecore:instanceClass="EObject"
ecore:name="attributes"/>
</xs:complexType>

I would like to see:

public interface Body extends EObject {

public EList<EObject> getElements();

}

Is that possible?

- Ricker
Re: xs:any as EList<EObject> [message #418245 is a reply to message #418244] Tue, 08 April 2008 14:27 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Ricker,

Comments below.


Jeffrey Ricker wrote:
> Is it possible to avoid feature maps and get xs:any as a list of EObject?
No. In fact there's no guarantee that all the values in the feature map
will be EObjects. They could just as easily be strings or other simple
values.
>
> Take the SOAP schema, for instance.
>
> <xs:complexType name="Body" >
> <xs:sequence>
> <xs:any namespace="##any" processContents="lax" minOccurs="0"
> maxOccurs="unbounded" ecore:instanceClass="EObject"
> ecore:name="elements"/>
> </xs:sequence>
> <xs:anyAttribute namespace="##other" processContents="lax"
> ecore:instanceClass="EObject"
> ecore:name="attributes"/>
> </xs:complexType>
>
> I would like to see:
>
> public interface Body extends EObject {
>
> public EList<EObject> getElements();
>
> }
>
> Is that possible?
Also, given an EObject, which is an instance of a complex type, you'd
have no information about what element it should be serialized under...
So perhaps what your wanting isn't consistent with the underlying
reality of the information (XML crap) being represented...
>
> - Ricker


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:How do I open an EMF generated editor ?
Next Topic:EcoreEditor alias Reflective Editor - IResourceChangeListener behavior on delete with marker
Goto Forum:
  


Current Time: Wed Apr 24 18:39:07 GMT 2024

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

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

Back to the top