Problem with XML modeling: Class 'name' is not found or is abstract. [message #1153545] |
Thu, 24 October 2013 17:37 |
Lefteris Skoutaris Messages: 24 Registered: March 2013 |
Junior Member |
|
|
Dear all,
I am new to eclipse and I am trying to model with EMF an XML instance file.
I have created a very very simple xml file and schema just for testing purposes and solving this problem. The xml instance below is valid against the schema. Therefore, there must be some kind of an issue with EMF?
XML instance:
<?xml version="1.0" encoding="utf-8"?>
<cdm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:/C:/Users/eleftherios.skoutari/workspace-indigo/XSDs/cdm_xml_bluebook_schema.xsd" id="CCSDS_CDM_VERS" version="1.0">
<header>
<CREATION_DATE>2010-03-12T22:31:12.000</CREATION_DATE>
</header>
</cdm>
Schema:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="cdm">
<xs:complexType>
<xs:sequence>
<xs:element name="header">
<xs:complexType>
<xs:sequence>
<xs:element name="CREATION_DATE" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="version" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
I have created a project,loaded the schema and generated the code. When I run the instance in an editor I get the following error:
org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'cdm' is not found or is abstract.
Any ideas why this is the case? Thank you in advance for any help you can provide!
[Updated on: Thu, 24 October 2013 17:39] Report message to a moderator
|
|
|
|
|
Re: Problem with XML modeling: Class 'name' is not found or is abstract. [message #1159185 is a reply to message #1159166] |
Mon, 28 October 2013 10:53 |
Ed Merks Messages: 33209 Registered: July 2009 |
Senior Member |
|
|
Lefteris,
Have you regenerated to see what EMF produces for you? Then you have
something that works and you can spend time figuring out how and why.
On 28/10/2013 11:40 AM, Lefteris Skoutaris wrote:
> Hi Ed,
>
> I have managed to parse the XML instance with a non-XML extension, but
> I would like to learn how this content type recognition works.
>
> The package org.eclipse.core.runtime.content and the plugin.xml
> includes the following content types.
>
> <plugin>
> <extension-point id="contentTypes" name="%contentTypesName"
> schema="schema/contentTypes.exsd"/>
> <extension point="org.eclipse.core.contenttype.contentTypes">
> <content-type id="org.eclipse.core.runtime.text"
> name="%textContentTypeName" priority="high"
> file-extensions="txt">
> <describer
> class="org.eclipse.core.internal.content.TextContentDescriber"/>
> <property name="org.eclipse.core.runtime.bom"/>
> <property name="org.eclipse.core.runtime.charset"/>
> </content-type>
> <content-type id="org.eclipse.core.runtime.xml"
> name="%xmlContentTypeName"
> base-type="org.eclipse.core.runtime.text"
> priority="high"
> file-extensions="xml">
> <property name="org.eclipse.core.runtime.charset"
> default="UTF-8"/>
> <describer
> class="org.eclipse.core.runtime.content.XMLContentDescriber"/>
> </content-type>
> <!-- a placeholder for setups where JDT's official type is not
> available -->
> <content-type id="org.eclipse.core.runtime.properties"
> name="%propertiesContentTypeName"
> base-type="org.eclipse.core.runtime.text"
> alias-for="org.eclipse.jdt.core.javaProperties"
> file-extensions="properties">
> <property name="org.eclipse.core.runtime.charset"
> default="ISO-8859-1"/>
> </content-type>
> </extension> </plugin>
>
>
> Do I have to somehow associate the instance file.xml with the
> project's plugins? If yes, how do I correlate the two? By setting at
> the ID the same namespace included in the file?I need to understand
> this concept first before making any changes.
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03715 seconds