Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Questions on JET transformation project
Questions on JET transformation project [message #600706] Fri, 05 January 2007 04:20
Eclipse UserFriend
Originally posted by:


I am trying to get a simple JET transformation project working.

My jet template file has the following:

-------------------------------------------------myJetTempla te.jet------------------------------------------------

<%-- contents of main.jet that reads handles a .ecore file --%>
<%-- import the ecore namespace --%>
<%@jet imports="org.eclipse.emf.ecore.*"%>

<c:setVariable var="ePackage" select="/EPackage"/>

<%-- write to the JET execution console --%>
EPackage: <c:get select="$ePackage/@name"/>
<c:iterate select="$ePackage/eClassifiers" var="eClassifier">
EClassifier ec = (EClassifier)context.getVariable("eClassifier");
EClassifier: <c:get select="$eClassifier/@name"/>. Really it&apos;s <%=
ec.getName() %>

-------------------------------------------------myJetTempla te.jet-----------------------------------------------------

my library.ecore has the following: re---------------------------------------------------------- ---

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:ecore="" name="library"
nsURI="" nsPrefix="library">
<eClassifiers xsi:type="ecore:EClass" name="Book">
<details key="name" value="Book"/>
<details key="kind" value="elementOnly"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="title"
unique="false" lowerBound="1"
<details key="kind" value="element"/>
<details key="name" value="title"/>
<eClassifiers xsi:type="ecore:EEnum" name="BookCategory">
<details key="name" value="BookCategory"/>
<eLiterals name="Mystery"/>
<eLiterals name="ScienceFiction" value="1"/>
<eLiterals name="Biography" value="2"/>
</ecore:EPackage> re---------------------------------------------------------- ---

My main.jet template from where the execution of jet begins has a call to
myJetTemplate.jet file.
When I supply "library.ecore" file as my Transformation Input from Run->Jet
Transformation through Eclipse,
I get the following error:
Error: Could not find a loader for

"dupEMFT being my project name"

I have specified the model loader as "org.eclipse.jet.xml" in the plugin.xml
file of my project.
Am i missing something else here.

Also, Can I use JET to read/transform (generate code) from the XML file
created using
a EMF/GMF editor generated from the library.ecore model. i.e I would like to
my code based on the contents of the xml file not the entities in the ecore
model (created
by importing my xsd)

Can i parse this xml file using ecore apis like the one in my jet template
above (myJetTemplate.jet).

<?xml version="1.0" encoding="UTF-8"?>
<library:Library xmlns:library="">
<title>About DLN</title>
<title>about mystery</title>

Please help.

Thanks in advance.

Previous Topic:[Teneo] Library Editor Example not working
Next Topic:Is ecore-based XML browsing possible?
Goto Forum:

Current Time: Sun Feb 28 07:54:18 GMT 2021

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

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

Back to the top