Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: for the plan.

Jump to: navigation, search

JET FAQ What kind of input model can JET handle?


What kind of input model can JET handle?


This is a two part answer. JET is capable of loading models, and of navigating them using XPath expressions. These are different capabilities.

Model loaders

Out of the box, JET can load the following kinds of Eclipse workspace resources:

  • XML documents (they get loaded usings EMF's generic XML mechanisms, not the W3 DOM), so, they are EMF models in memory.
  • EMF-base models. That is any model that was created via EMF, and for which there is a registered Resource Factory
  • The Eclipse Workspace itself.

By default, JET will attempt to load a workspace resource as an EMF file. However, each type of loading is represented by a 'model loader' which can be explicitly declared in the JET transformation's plugin.xml on the Extension tab. The following table shows the out-of-the-box model loaders defined in JET. These model loader IDs may also be specified in the c:load and c:loadContent tags.

Model loader ids defined by JET
ID Description
org.eclipse.jet.emfxml Load XML document via EMF's generic XML support
org.eclipse.jet.emf Load EMF document looking up the files extension in the EMF Resource Factory registry
org.eclipse.jet.resource Load an Eclipse IResource as an IResource

To tell JET to use a specific model loader when running a transformation, set the modelLoader attribute on the JET transformation extension in plugin.xml. This sample explicitly sets the model loader to org.eclipse.jet.emf

 ... rest of file omitted

XPath navigation

Out of the box, JET can navigate the following input models using XPath expressions:

  • XML documents (represented in the w3 document object model - W3 DOM)
  • EMF-based models
  • The Eclipse workspace resources (IResource, IContainer, IFolder, IProject, IFile).

Navigating XML documents with XPath is well defined. JET provides some enhancements for navigating EMF models. Below are some examples of navigating the Eclipse workspace with XPath:

<c:load url="{$}" 
  Contents of <c:get select="$myProject/@name"/>:
  <c:iterate select="$myProject/*" var="child">
    <c:get select="$child/@name"/> (<c:get select="local-name($child)"/>)

  Attributes of <c:get select="$myProject/@name"/>:
  <c:iterate select="$myProject/@*" var="attr">
    <c:get select="local-name($attr)"/> = <c:get select="$attr"/>

Back to the M2T-JET-FAQ

Back to the top