[xsd2ecore] mapping of sequence of xs:any and adding elements to it [message #991052] |
Mon, 17 December 2012 03:24  |
Eclipse User |
|
|
|
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 10:19  |
Eclipse User |
|
|
|
<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>
<xs:complexType name="data-extension.type" mixed="true">
<br>
</xs:complexType>
<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>
|
|
|
Powered by
FUDForum. Page generated in 0.03200 seconds