summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2007-02-01 10:34:35 (EST)
committer pelder2007-02-01 10:34:35 (EST)
commita9de80fa6df1045153de6289d61ac1dc33ab52c8 (patch)
treeca460cf608974392e2abfc3558888f17c14be5e9
parent30099b84c9b3e7fd2347bbb5a3e5d263279fd556 (diff)
downloadorg.eclipse.jet-a9de80fa6df1045153de6289d61ac1dc33ab52c8.zip
org.eclipse.jet-a9de80fa6df1045153de6289d61ac1dc33ab52c8.tar.gz
org.eclipse.jet-a9de80fa6df1045153de6289d61ac1dc33ab52c8.tar.bz2
[172505] Fix factual and spelling mistakes
-rw-r--r--doc/org.eclipse.jet.doc/references/ant/antTasks.xhtml13
-rw-r--r--doc/org.eclipse.jet.doc/tasks/usingJetWithEMF.xhtml101
-rw-r--r--doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml40
3 files changed, 84 insertions, 70 deletions
diff --git a/doc/org.eclipse.jet.doc/references/ant/antTasks.xhtml b/doc/org.eclipse.jet.doc/references/ant/antTasks.xhtml
index 0474f8c..b8d3c58 100644
--- a/doc/org.eclipse.jet.doc/references/ant/antTasks.xhtml
+++ b/doc/org.eclipse.jet.doc/references/ant/antTasks.xhtml
@@ -26,9 +26,12 @@
<a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/javadoc/org/eclipse/jet/compiler/JET2Compiler.html">
JET2Compiler</a>. Typical usage is:</p>
- <pre>&lt;jet.compile project=&quot;myProject&quot; destDir=&quot;src-gen&quot; srcDir=&quot;templates&quot;&gt;
- &lt;srcdir dir=&quot;templates&quot;/&gt;
-&lt;/jet.compile&gt;</pre>
+ <pre>
+&lt;!-- Compile the JET templates in project my.jet.plugin --&gt;
+&lt;jet.compile project="my.jet.plugin" destdir="jet2java"&gt;
+ &lt;srcdir dir="." includes="**/*.jet"/&gt;
+&lt;/jet.compile&gt;
+ </pre>
<ul>
<li><b>project</b> is the name of the Eclipse project containing
@@ -40,8 +43,8 @@
<li><b>srcDir</b> is an Ant
<a href="http://ant.apache.org/manual/CoreTypes/fileset.html">
- Fileset</a>, allowing specification template locations and file
- match rules.</li>
+ Fileset</a>, specifying template locations and file
+ match rules. The <b>dir</b> attribute is required, an must be relative to the JET project path.</li>
</ul>
diff --git a/doc/org.eclipse.jet.doc/tasks/usingJetWithEMF.xhtml b/doc/org.eclipse.jet.doc/tasks/usingJetWithEMF.xhtml
index 5f790d7..dd19984 100644
--- a/doc/org.eclipse.jet.doc/tasks/usingJetWithEMF.xhtml
+++ b/doc/org.eclipse.jet.doc/tasks/usingJetWithEMF.xhtml
@@ -15,76 +15,87 @@
<h2>Using JET Transformations with EMF Documents</h2>
- <p>By default, JET transformations expect an XML documents as
- input. However, transformations can be modified to load EMF-based
- models as input. This section describes how to load EMF documents
+ <p>By default, JET transformations expect an XML document as
+ input. However, JET transformations can be modified to load EMF-based
+ models, too. This section describes how to load EMF documents
with JET and how JET accesses the models.</p>
<h3>Loading EMF Documents</h3>
- <p>To force JET to load an EMF document, the transformation
- information must be modified in the transformations plugin.xml.
- Follow the following steps:</p>
+ <p>To enable a JET Transformation to load an EMF document, the transformation&apos;s plugin.xml
+ must be modified.
+ Do the following:</p>
- <ul>
+ <ol>
<li>Open the plugin.xml file in the root of the JET
transformation project.</li>
- <li>Switch to the &apos;Extensions&apos; tab.</li>
+ <li>Click on the <strong>Extensions</strong> tab.</li>
- <li>Find the &apos;org.eclipse.jet.transform&apos; extension in
- the &apos;All Extensions&apos; tree, and expand it to reveal the
- &apos;transform&apos; child element.</li>
+ <li>Expand the <strong>org.eclipse.jet.transform</strong> element in
+ the <strong>All Extensions</strong> tree. This will reveal the
+ <strong>(transform)</strong> child element.</li>
- <li>Select the &apos;transform&apos; element, and enter
- <code>org.eclipse.jet.emf</code> in the &apos;modelLoader&apos;
- field.</li>
+ <li>Click on the <strong>(transform)</strong> element.</li>
+ <li>In the <strong>modelLoader</strong>
+ field, enter <code>org.eclipse.jet.emf</code> .</li>
- </ul>
+ </ol>
<h3>XPath expressions against EMF documents</h3>
- <p>The JET XPath processor handles EMF documents by mapping the EMF
+ <p>The JET XPath processor handles EMF documents by mapping the document&apos;s
meta-model to the XPath infoset model as follows:</p>
<ul>
<li>
<a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/resource/Resource.html"
- >Resource</a> objects map to the infoset &apos;root&apos; object.
+ >Resource</a> objects map to the infoset <i>;root</i> object.
The XPath expression <code>/</code> refers to the Resource
containing the input model.</li>
- <li>The Resource
+ <li>The Resource contents, as returned by the
<a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/resource/Resource.html#getContents()"
- >getContents()</a> method maps to an element
- &apos;contents&apos;. The XPath expression <code>/contents</code>
+ >getContents()</a> method, maps to an element
+ <i>contents</i>. The XPath expression <code>/contents</code>
returns the results of this method.</li>
<li>Each
<a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/EReference.html"
>EReference</a> feature on an object is mapped to an element with
- the same name.</li>
+ the same name.
+ If <code>$class</code> refers to an EObject with an EReference <code>ownedAttributes</code>, then
+ <code>$class/ownedAttributes</code> will return all the elements in that collection.
+ </li>
<li>Each
<a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/EAttribute.html"
>EAttribute</a> feature on an object is mapped to an attribute
- with the same name.</li>
+ with the same name.
+ If <code>$class</code> refers to an EObject with an EAttribute <code>name</code>, then
+ <code>$class/@name</code> will return the value of this attribute.
+ </li>
<li>When evaluating XPath child-axis expressions, JET will first
attempt to identify an feature with the requested name. If no
feature is found, then the contained children of the element are
- searched for instances of an EClass with the specified name.</li>
+ searched for instances of an EClass with the specified name.
+ For example, if the <code>$class</code> refers to an EObject that contains instances of an EClass <code>Property</code>
+ in any of its reference features, the <code>$class/Property</code> will return those objects.
+ </li>
</ul>
- <p>If a JET transform loads an ECore model, then the following
+ <h3>Example: XPath expressions against .ecore files</h3>
+
+ <p>If a JET transform loads an ECore model (a .ecore file), then the following
XPath expressions would return the following results:</p>
- <table>
+ <table border="1">
- <thead>
+ <thead align="left">
<tr>
@@ -110,7 +121,7 @@
<td><code>/EPackage</code></td>
- <td>subset of <code>Resource.getContents()</code> of type
+ <td>the subset of <code>Resource.getContents()</code> of type
<code>EPackage</code></td>
</tr>
@@ -128,7 +139,7 @@
<td><code>$ePackage/EClass</code></td>
- <td>subset of <code>ePackage.eContents()</code> of type
+ <td>the subset of <code>ePackage.eContents()</code> of type
<code>EClass</code></td>
</tr>
@@ -154,7 +165,7 @@
the model with both XPath and Java expressions</p>
<pre>&lt;%-- contents of main.jet that reads handles a .ecore file --%&gt;
-&lt;%-- import the ecore namespace --%&gt;
+&lt;%-- import the ecore namespace, needed for Java expressions --%&gt;
&lt;%@jet imports=&quot;org.eclipse.emf.ecore.*&quot;%&gt;
&lt;c:setVariable var=&quot;ePackage&quot; select=&quot;/contents&quot;/&gt;
@@ -169,11 +180,12 @@ EClassifier ec = (EClassifier)context.getVariable(&quot;eClassifier&quot;);
EClassifier: &lt;c:get select=&quot;$eClassifier/@name&quot;/&gt;. Really it&apos;s &lt;%= ec.getName() %&gt;
&lt;/c:iterate&gt;
&lt;/c:log&gt;</pre>
+
<h3>Details of EMF Document loading</h3>
- <p>JET uses EMF EMF&apos;s ResourceSetImpl createResource() method
- to determine EMF-based models. JET requires the model&apos;s
- EPackage is registered with EMF in order to load model
+ <p>JET uses the EMF method ResourceSetImpl.createResource()
+ to create a Resource implementation capable of loading themode.
+ This requires the model&apos;s EPackage is registered with EMF in order to load model
instances.</p>
<p>The Model loader id for EMF document loading is
@@ -181,32 +193,29 @@ EClassifier ec = (EClassifier)context.getVariable(&quot;eClassifier&quot;);
<h3>Loading EMF documents during transformation execution</h3>
- <p>EMF documents my by loaded using the
+ <p>The launch framework automatically handles the loading of EMF resources passed to a JET
+ Transformation as input. If required, JET templates can load other EMF-based documents
+ during execution.
+ The
<a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/controlTags/loadTag.html"
>&lt;c:load&gt;</a> and
<a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/controlTags/loadContentTag.html"
- >&lt;c:loadContent&gt;</a> tags. The former loads a document from
- an file, while the second loads the document by parsing a text
- string.</p>
+ >&lt;c:loadContent&gt;</a> tags may be used for this purpose.
+ The former loads a document from
+ an file, while the second loads the document by parsing the content of the c:loadContent tag.</p>
- <p>The following loads the mymodel.ecore file from the
- transformation:</p>
+ <p>The following loads the mymodel.ecore file that is part of the transformation plug-in:</p>
<p><code>&lt;c:load url=&quot;mymodel.ecore&quot;
- var=&quot;myEcore&quot;/&gt;</code></p>
-
- <p>This is equivalent to:</p>
-
- <p><code>&lt;c:load url=&quot;mymodel.ecore&quot;
- urlContext=&quot;transform&quot;
loader=&quot;org.eclipse.jet.emf&quot;
var=&quot;myEcore&quot;/&gt;</code></p>
- <p>The following example loads the plugin.xml document from a
- project &apos;myproject&apos; in the Eclipse workspace.</p>
+ <p>The following example loads the file mymodel.ecore from a workspace
+ project myproject.</p>
<p><code>&lt;c:load url=&quot;myproject/mymodel.ecore&quot;
urlContext=&quot;workspace&quot;
+ loader=&quot;org.eclipse.jet.emf&quot;
var=&quot;myEcore&quot;/&gt;</code></p>
<p>Finally, while it is possible to load ecore models with
diff --git a/doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml b/doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml
index 72cc43f..8127d08 100644
--- a/doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml
+++ b/doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml
@@ -17,7 +17,7 @@
<p>By default, JET transformations expect an XML documents as
input. XML documents are loaded into memory using the Eclipse
- Modeling Framework (EMF) XML document support</p>
+ Modeling Framework (EMF) XML document support.</p>
<h3>XPath expressions against XML documents</h3>
@@ -27,7 +27,7 @@
<ul>
<li>The XPath processor matches expressions containing
- unqualified names with elements and attributes that use include a
+ unqualified names with elements and attributes that include a
namespace prefix. XPath expressions can still determine the
namespace URI of an element or attribute via the
<a href="http://www.w3.org/TR/xpath#function-namespace-uri">
@@ -37,16 +37,16 @@
<h3>Details of XML Document loading</h3>
- <p>JET uses EMF&apos;s
- <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/xml/type/util/XMLTypeResourceImpl.html"
- >XMLTypeResoureImpl</a> to load XML documents. Documents are loaded
+ <p>JET uses the EMF
+ <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/xmi/impl/GenericXMLResourceFactoryImpl.html"
+ >GenericXMLResourceFactoryImpl</a> to load XML documents. Documents are loaded
as follows:</p>
<ul>
<li>If the document contains an XML schema declaration, and the
Eclipse XSD feature is installed (org.eclipse.xsd), and the XSD
- location can be located, then the document is loaded according to
+ file can be located, then the document is loaded according to
the XSD.</li>
<li>When loading with an XSD, EMF will use the Java classes
@@ -70,7 +70,10 @@
<h3>Loading XML documents during transformation execution</h3>
- <p>XML documents my by loaded using the
+ <p>The launch framework automatically handles the loading of EMF resources passed to a JET
+ Transformation as input. If required, JET templates can load other EMF-based documents
+ during execution.
+ XML documents may by loaded using the
<a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/controlTags/loadTag.html"
>&lt;c:load&gt;</a> and
<a href="PLUGINS_ROOT/org.eclipse.jet.doc/references/taglibs/controlTags/loadContentTag.html"
@@ -91,7 +94,7 @@
loader=&quot;org.eclipse.jet.emfxml&quot;
var=&quot;pluginXML&quot;/&gt;</code></p>
- <p>The following example loads the plugin.xml document from a
+ <p>The following example loads the file plugin.xml from a
project &apos;myproject&apos; in the Eclipse workspace.</p>
<p><code>&lt;c:load url=&quot;myproject/plugin.xml&quot;
@@ -110,26 +113,25 @@
<h3>Loading XML documents with non-standard extensions</h3>
<p>The XML model loader is only associated with the &apos;xml&apos;
- file extension. To load documents with other extensions as XML
+ file extension. To load XML documents with other extensions as XML
documents, configure the transformation as follows:</p>
- <ul>
+ <ol>
<li>Open the plugin.xml file in the root of the JET
transformation project.</li>
- <li>Switch to the &apos;Extensions&apos; tab.</li>
+ <li>Click on the <strong>Extensions</strong> tab.</li>
- <li>Find the &apos;org.eclipse.jet.transform&apos; extension in
- the &apos;All Extensions&apos; tree, and expand it to reveal the
- &apos;transform&apos; child element.</li>
+ <li>Expand the <strong>org.eclipse.jet.transform</strong> element in
+ the <strong>All Extensions</strong> tree.</li>
- <li>Select the &apos;transform&apos; element, and enter
- <code>org.eclipse.jet.emfxml</code> in the
- &apos;modelLoader&apos; field, and <code>xml</code> in the
- &apos;modelExtension&apos; field.</li>
+ <li>Click on the <strong>(transform)</strong> element</li>
+ <li>In the <strong>modelLoader</strong> field, and enter
+ <code>org.eclipse.jet.emfxml</code>.</li>
+ <li>In the <strong>modelExtension</strong> field, enter <code>xml</code>.</li>
- </ul>
+ </ol>
<p>
<img alt="Image of plug-in editor showing setting of &apos;modelLoader&apos; and &apos;modelExtension&apos; attributes."