Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml')
-rw-r--r--doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml143
1 files changed, 0 insertions, 143 deletions
diff --git a/doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml b/doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml
deleted file mode 100644
index 8127d08..0000000
--- a/doc/org.eclipse.jet.doc/tasks/usingJetWithXML.xhtml
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-
- <head>
-
- <title>Using JET Transformations with XML Documents</title>
-
- <link charset="ISO-8859-1" href="../book.css" rel="STYLESHEET"
- type="text/css"/>
-
- </head>
-
- <body>
-
- <h2>Using JET Transformations with XML Documents</h2>
-
- <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>
-
- <h3>XPath expressions against XML documents</h3>
-
- <p>The JET XPath processor handles XML documents according to the
- XPath 1.0 specification, with the following exception:</p>
-
- <ul>
-
- <li>The XPath processor matches expressions containing
- 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">
- namespace-uri</a> XPath function.</li>
-
- </ul>
-
- <h3>Details of XML Document loading</h3>
-
- <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
- 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
- registered against the schema, if they exist. Otherwise, Dynamic
- <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/EClass.html"
- >EClasses</a> will be generated, and loaded objects will be of
- type
- <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/EObject.html"
- >EObject</a>.</li>
-
- <li>If no XSD schema is supplied, or the schema cannot be located
- and there are no registered EMF Java classes for the schema, then
- XML elements are loaded as instances of
- <a href="PLUGINS_ROOT/org.eclipse.emf.doc/references/javadoc/org/eclipse/emf/ecore/xml/type/AnyType.html"
- >AnyType</a>.</li>
-
- </ul>
-
- <p>The Model loader id for XML document loading is
- <code>org.eclipse.jet.emfxml</code>.</p>
-
- <h3>Loading XML documents during transformation execution</h3>
-
- <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"
- >&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>
-
- <p>The following loads the plugin.xml file from the
- transformation:</p>
-
- <p><code>&lt;c:load url=&quot;plugin.xml&quot;
- var=&quot;pluginXML&quot;/&gt;</code></p>
-
- <p>This is equivalent to:</p>
-
- <p><code>&lt;c:load url=&quot;plugin.xml&quot;
- urlContext=&quot;transform&quot;
- loader=&quot;org.eclipse.jet.emfxml&quot;
- var=&quot;pluginXML&quot;/&gt;</code></p>
-
- <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;
- urlContext=&quot;workspace&quot;
- var=&quot;pluginXML&quot;/&gt;</code></p>
-
- <p>Finally, this example loads the contents of the c:loadContent
- tag as an XML document:</p>
-
- <pre>&lt;c:loadContent var=&quot;myDoc&quot;&gt;
- &lt;parts&gt;
- &lt;item sku=&quot;123&quot; price=&quot;1.55&quot;&gt;Widget A&lt;/item&gt;
- &lt;item sku=&quot;456&quot; price=&quot;2.99&quot;&gt;Widget B&lt;/item&gt;
- &lt;/parts&gt;
-&lt;/c:loadContent&gt;</pre>
- <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 XML documents with other extensions as XML
- documents, configure the transformation as follows:</p>
-
- <ol>
-
- <li>Open the plugin.xml file in the root of the JET
- transformation project.</li>
-
- <li>Click on the <strong>Extensions</strong> tab.</li>
-
- <li>Expand the <strong>org.eclipse.jet.transform</strong> element in
- the <strong>All Extensions</strong> tree.</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>
-
- </ol>
-
- <p>
- <img alt="Image of plug-in editor showing setting of &apos;modelLoader&apos; and &apos;modelExtension&apos; attributes."
- src="images/forceXMLLoader.png"/></p>
-
- </body>
-
-</html>
-

Back to the top