Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [xsd2ecore] mapping of sequence of xs:any and adding elements to it
[xsd2ecore] mapping of sequence of xs:any and adding elements to it [message #991052] Mon, 17 December 2012 08:24 Go to next message
Andreas Brieg is currently offline Andreas BriegFriend
Messages: 48
Registered: November 2012
Member
Hi,

I have a a xsd2ecore mapping for the following xsd fragment:

<xs:complexType name="data-extension.type" mixed="true">
</xs:complexType>


This complex type is mapped to an EClass with an attribute mixed of type EFeatureMapEntry.

I would like to know, how I can add elements to the underlying FeatureMap. The problem is that I get class cast exception during invocation of an add operation, saying that the element is not of type EFeatureMapEntry. However I'm not able to create an instance of EFeatureMapEntry with org.eclipse.emf.ecore.util.FeatureMapUtil.createEntry(EStructuralFeature, Object), because the object parameter already needs to be of type EFeatureMapEntry.

Might there be a problem with the xsd2ecore mapping? Should I specify a different type for the attribute mixed?
Re: [xsd2ecore] mapping of sequence of xs:any and adding elements to it [message #991165 is a reply to message #991052] Mon, 17 December 2012 15:19 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 29040
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Andreas, <br>
<br>
This article will help a bit:<br>
<blockquote><a target="_out"
href="http://www.theserverside.com/tt/articles/article.tss?l=BindingXMLJava">Binding
XML to Java</a><br>
</blockquote>
The entries of such a feature map must use an element-based feature
from a DocumentRoot class of some model (and of course the
value/object must be of that element feature's type).<br>
<br>
<br>
<div class="moz-cite-prefix">On 17/12/2012 12:24 AM, Andreas Brieg
wrote:<br>
</div>
<blockquote cite="mid:kamks7$lqh$1@xxxxxxxxe.org" type="cite">Hi,
<br>
<br>
I have a a xsd2ecore mapping for the following xsd fragment:
<br>
<br>
<br>
&lt;xs:complexType name="data-extension.type" mixed="true"&gt;
<br>
&lt;/xs:complexType&gt;
<br>
<br>
<br>
This complex type is mapped to an EClass with an attribute mixed
of type EFeatureMapEntry.
<br>
<br>
I would like to know, how I can add elements to the underlying
FeatureMap. The problem is that I get class cast exception during
invocation of an add operation, saying that the element is not of
type EFeatureMapEntry. However I'm not able to create an instance
of EFeatureMapEntry with
org.eclipse.emf.ecore.util.FeatureMapUtil.createEntry(EStructuralFeature,
Object), because the object parameter already needs to be of type
EFeatureMapEntry.
<br>
<br>
Might there be a problem with the xsd2ecore mapping? Should I
specify a different type for the attribute mixed?
<br>
</blockquote>
<br>
</body>
</html>
Previous Topic:[CDO] Success Stories?
Next Topic:[CDO] ArrayIndexOutOfBoundsException in CDOIDUtil
Goto Forum:
  


Current Time: Sun Dec 17 14:03:14 GMT 2017

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

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