Java Reference
In-Depth Information
One thing to note when generating HTML with templates is that you have
to deal with all those pesky angle brackets. The M2M approach benefited from
the fact that we dealt directly with the elements and attributes, without the con-
cern of matching brackets or even having to see them. Then again, we needed to
deal with the abstract syntax that was clearly not created to be “Toolsmith
friendly.” Perhaps the best thing for HTML would be a textual concrete syntax
and generated editor from the TMF project. In addition, it would be nice if our
template editor were aware not only of our template language syntax, but also
of our domain model. Perhaps someday it will be possible to generate hybrid
template editors that can provide this capability.
The following is the workflow definition used to invoke our report template
for this sample. Note the use of the XmlBeautifier postprocessor.
<?xml version="1.0"?>
< workflow >
< property name="model"
value="platform:/resource/org.eclipse.dsl.requirements/
model/Requirements.xmi" />
< property name="out" value="out" />
< bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
< platformUri value="../" />
< RegisterEcoreFile
value="platform:/resource/org.eclipse.dsl.scenario/
model/scenario.ecore"/>
</ bean >
< component class="org.eclipse.emf.mwe.utils.Reader">
< uri value="${model}" />
< modelSlot value="model" />
</ component >
< component class="org.eclipse.xpand2.Generator">
< metaModel id="mm"
class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
< expand value="requirements2html::Main FOR model" />
< outlet path="${out}">
< postprocessor class="org.eclipse.xpand2.output.XmlBeautifier"/>
</ outlet >
</ component >
</workflow>
Search WWH ::




Custom Search