Home » Modeling » Epsilon » XSD to EMF(Model instance not persisting)
| | |
Re: XSD to EMF [message #484581 is a reply to message #484577] |
Tue, 08 September 2009 11:06 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi James,
Thanks for the update. I'll give the xsd a go and get back to you.
Cheers,
Dimitris
James Williams wrote:
> Hi Dimitris,
>
> When opening it with the Sample Reflective Ecore Model Editor (as either
> .xmi or .ecore), I get the following (trimmed as they were massive) errors:
>
> Quote:
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos
>> ticWrappedException:
>> org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'zSect'
>> not found. (platform:/resource/ZML/model/birthdaybook.xmi, 3, 43)
>> at ........
>
>
> and
>
> Quote:
>> org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'zSect'
>> not found. (platform:/resource/ZML/model/birthdaybook.xmi, 3, 43)
>> at ........
>
>
> Cheers,
>
> James
--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
|
|
|
Re: XSD to EMF [message #484586 is a reply to message #484581] |
Tue, 08 September 2009 11:32 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Just so as not to leave this thread hanging. This has been resolved
off-line and the short story is that when creating a model from an Ecore
that has been generated from an XSD, in the New EMF Model wizard of
Epsilon, you should select DocumentRoot as the Root Instance type and
add all other objects below that.
Cheers,
Dimitris
Dimitris Kolovos wrote:
> Hi James,
>
> Thanks for the update. I'll give the xsd a go and get back to you.
>
> Cheers,
> Dimitris
>
> James Williams wrote:
>> Hi Dimitris,
>>
>> When opening it with the Sample Reflective Ecore Model Editor (as
>> either .xmi or .ecore), I get the following (trimmed as they were
>> massive) errors:
>>
>> Quote:
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos
>>> ticWrappedException:
>>> org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'zSect'
>>> not found. (platform:/resource/ZML/model/birthdaybook.xmi, 3, 43)
>>> at ........
>>
>>
>> and
>>
>> Quote:
>>> org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'zSect'
>>> not found. (platform:/resource/ZML/model/birthdaybook.xmi, 3, 43)
>>> at ........
>>
>>
>> Cheers,
>>
>> James
>
>
--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
|
|
| |
Re: XSD to EMF [message #580480 is a reply to message #580442] |
Tue, 08 September 2009 11:06 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Hi James,
Thanks for the update. I'll give the xsd a go and get back to you.
Cheers,
Dimitris
James Williams wrote:
> Hi Dimitris,
>
> When opening it with the Sample Reflective Ecore Model Editor (as either
> .xmi or .ecore), I get the following (trimmed as they were massive) errors:
>
> Quote:
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos
>> ticWrappedException:
>> org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'zSect'
>> not found. (platform:/resource/ZML/model/birthdaybook.xmi, 3, 43)
>> at ........
>
>
> and
>
> Quote:
>> org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'zSect'
>> not found. (platform:/resource/ZML/model/birthdaybook.xmi, 3, 43)
>> at ........
>
>
> Cheers,
>
> James
--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
|
|
|
Re: XSD to EMF [message #580492 is a reply to message #484581] |
Tue, 08 September 2009 11:32 |
Dimitrios Kolovos Messages: 1776 Registered: July 2009 |
Senior Member |
|
|
Just so as not to leave this thread hanging. This has been resolved
off-line and the short story is that when creating a model from an Ecore
that has been generated from an XSD, in the New EMF Model wizard of
Epsilon, you should select DocumentRoot as the Root Instance type and
add all other objects below that.
Cheers,
Dimitris
Dimitris Kolovos wrote:
> Hi James,
>
> Thanks for the update. I'll give the xsd a go and get back to you.
>
> Cheers,
> Dimitris
>
> James Williams wrote:
>> Hi Dimitris,
>>
>> When opening it with the Sample Reflective Ecore Model Editor (as
>> either .xmi or .ecore), I get the following (trimmed as they were
>> massive) errors:
>>
>> Quote:
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos
>>> ticWrappedException:
>>> org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'zSect'
>>> not found. (platform:/resource/ZML/model/birthdaybook.xmi, 3, 43)
>>> at ........
>>
>>
>> and
>>
>> Quote:
>>> org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'zSect'
>>> not found. (platform:/resource/ZML/model/birthdaybook.xmi, 3, 43)
>>> at ........
>>
>>
>> Cheers,
>>
>> James
>
>
--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
|
|
|
Re: XSD to EMF [message #1404043 is a reply to message #484586] |
Tue, 29 July 2014 10:01 |
Gerd Wierse Messages: 14 Registered: July 2009 |
Junior Member |
|
|
Hi,
I'd like to pick up this thread as I've got the same feature not found exception.
I get it due to upper case letters in XML tags, while loading a XML instance for an ecore model.
Starting from a very simple XML Scheme File MyXSD.xml
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="MyXSD" xmlns:xs="..." elementFormDefault="qualified" targetNamespace="MyXSD">
<xs:element name="Document" type="Document"/>
<xs:complexType name="Document">
<xs:sequence>
<xs:element name="FirstElem" type="Max10Text"/>
<xs:element name="SecondElem" type="Max20Text"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="Max10Text"> ... </xs:simpleType>
<xs:simpleType name="Max20Text"> ... </xs:simpleType>
</xs:schema>
I have got ecore and genmodel, generated editors and everything works fine.
By ANT script, I register my ecore model and I try to load the following XML instance in Epsilon:
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="MyXSD" xmlns:xsi="...">
<FirstElem>FirstElem</FirstElem>
<SecondElem>SecondElement</SecondElem>
</Document>
At this step, I get a feature not found exception "Caused by: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'FirstElem' not found."
Changing the first letter of inner element tags from upper case to lower case, loading of this instance succeeds.
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="MyXSD" xmlns:xsi="...">
<firstElem>FirstElem</firstElem>
<secondElem>SecondElement</secondElem>
</Document>
Exceed editor and Eclipse Validation, of course, accept the first version of this file and complain about the second version with lower case letters.
May be, I am missing some parameter for loading the XML instance or any other detail?
Do you need any additional information?
Thanks in advance,
Gerd
eclipse-epsilon-1.1_SR1-win32-x86_64
Windows 7 64 bit with Java 1.7 update 60
|
|
| | |
Re: XSD to EMF [message #1404175 is a reply to message #1404168] |
Wed, 30 July 2014 09:00 |
|
Hi Gerd,
I haven't been able to reproduce this in my setup (Epsilon loads the uppercase file without problems but reports errors with the lowercase file - as expected). Could you please share the complete projects?
Cheers,
Dimitris
|
|
| |
Re: XSD to EMF [message #1404382 is a reply to message #1404194] |
Thu, 31 July 2014 19:27 |
|
Hi Gerd,
Replacing your epsilon.emf.loadModel task with the following seems to be doing the trick:
<epsilon.emf.loadXmlModel name="MyXSD" modelfile="instances/MyXSDInstance.upperCase.xml" xsdfile="model/MyXSD.xsd" read="true" store="false"/>
Cheers,
Dimitris
|
|
| | | | |
Re: XSD to EMF [message #1413485 is a reply to message #1413019] |
Thu, 28 August 2014 16:41 |
|
Hi Gerd,
You'll need to use the XmlModel specialisation of EmfModel. Something like the following should do the trick:
import java.io.File;
import org.eclipse.epsilon.common.util.StringProperties;
import org.eclipse.epsilon.emc.emf.xml.XmlModel;
public class App {
public static void main(String[] args) throws Exception {
XmlModel model = new XmlModel();
StringProperties sp = new StringProperties();
sp.put(XmlModel.PROPERTY_NAME, "M");
sp.put(XmlModel.PROPERTY_READONLOAD, true);
sp.put(XmlModel.PROPERTY_STOREONDISPOSAL, false);
sp.put(XmlModel.PROPERTY_XSD_FILE, <XSD absolute path>);
sp.put(XmlModel.PROPERTY_MODEL_FILE, <XML absolute path>);
model.load(sp, null);
System.out.println(model.getAllOfKind(<Some type>));
}
}
Cheers,
Dimitris
|
|
| |
Re: XSD to EMF [message #1416071 is a reply to message #1416059] |
Thu, 04 September 2014 09:12 |
|
Hi Gerd,
You should either set the modelName attribute of your EVL extension to "MyXSD", or omit the MyXSD! prefix in your .evl file.
Cheers,
Dimitris
|
|
| | |
Goto Forum:
Current Time: Thu Apr 25 09:10:41 GMT 2024
Powered by FUDForum. Page generated in 0.04200 seconds
|