|Question Generating from XSD [message #1764218]
||Fri, 26 May 2017 17:42
| Geoffry Roberts
Registered: July 2016
There must be a workaround for this problem. I would like to what it is.|
Mucho thanks to who ever knows this.
I generated an EMF graph from the a schema that contains the following fragment. The fragment shows and element and it's type:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://standards.ieee.org/IEEE1516-2010" xmlns:ns="http://standards.ieee.org/IEEE1516-2010" targetNamespace="http://standards.ieee.org/IEEE1516-2010" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2010">
<xs:element name="objectModel" type="objectModelType"/>
<xs:element name="modelIdentification" type="modelIdentificationType" minOccurs="0">
<xs:documentation>documents certain key identifying information within the object model description
The generated EMF cannot read the following, valid XML. It fails at the first element shown:
<objectModel xsi:schemaLocation="http://standards.ieee.org/IEEE1516-2010 http://standards.ieee.org/downloads/1516/1516.2-2010/IEEE1516-DIF-2010.xsd" xmlns="http://standards.ieee.org/IEEE1516-2010" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
and yields the following error:
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'objectModel' is not found or is abstract. (file:/Users/gcr1/hopeWorkspace/interaction-injection/output/TripleFederation.xml, 2, 252)
|Re: Question Generating from XSD [message #1764540 is a reply to message #1764531]
||Wed, 31 May 2017 06:44
| Ed Merks
Registered: July 2009
If you invoke Generate Test Code in the GenModel it will generate a test project that includes a sample for saving and loading instances. It will be named XyzExample.java, I suppose for you that would be _2010Example.java (given you mention _2010Factory). It looks like this for the LibraryExample.java|So I imagine you must have a _2010ResourceFactoryImpl (in the util package of the model project) that you should use and should register your _2010Package.eINSTANCE...
public static void main(String args)
// Create a resource set to hold the resources.
ResourceSet resourceSet = new ResourceSetImpl();
// Register the appropriate resource factory to handle all file extensions.
// Register the package to ensure it is available during loading.
Professional Support: https://www.macromodeling.com/
Powered by FUDForum
. Page generated in 0.01723 seconds