JET equivalents of DPTK tags

You can use the mapping table in this topic to understand the differences between JET and Design Pattern Toolkit (DPTK) tags.
This mapping table compares the equivalent JET tag and DPTK tag. The comments column summarizes any special issues with the migration.
DPTK tag JET tag Comments
applyPattern c:invokeTransform  
attr c:get
The format attribute of the attr tag is not supported by the c:get tag. JET provides a number of XPath functions as equivalents. The following DPTK tag is equivalent to the JET tag:
  • DPTK tag - <attr node="child" name="name" format="U"/>
  • JET tag - <c:get select="upper-case($child/@name)"/>
case c:when See the notes on select.
cond c:if The XPath function cardinality interprets the card attribute values of the cond tag.
  • DPTK- <cond node="parent/children" card="m"> ....</cond>
  • JET - <c:if test="cardinality($parent/children,'m')"> ....</c:if>
content c:get The following are equivalent:
  • DPTK - <content node="parent"/>
  • JET - <c:get select="$parent"/>
See attr for details on converting the DPTK format attribute.
copyResource ws:copyFile See the notes on select.
exists c:if Use <c:if test=" ... "> ... </c:if>.
The following table gives equivalences of common <exists> forms:
<exists node="mother/children"> <c:if test="$mother/children">
<exists node="mother/children gender='F'"> <c:if test="$mother/children[@gender = 'F']">
<exists node="child gender='F'"> <c:if test="$child/@gender = 'F'">
<exists node="person" name="partner"> <c:if test="$person/@partner">
extend c:load  
formatNow f:formatNow  
genParm No direct equivalent Parameters passed to JET transformations are exposed as XPath variables.
include c:include  
inlineExtend c:loadContent  
initialCode c:initialCode  
iterate c:iterate  
marker c:marker  
milliseconds f:milliseconds  
newFolder ws:folder  
newNode c:addElement  
newProject ws:project  
newText c:addTextElement  
nexists c:if Use <c:if test="not( ... )"> ...</c:if>. See exists tag for more examples.
nodeAttributes No direct equivalent The following c:iterate statement iterates over all attributes of an element:
<c:iterate select="$element/@*" var="attr">    
	<c:get select="name($attr)"/> = <c:get select="string($attr)"/>
</c:iterate>
overrides c:override Although provided, users are encouraged to use the overrides attribute of the transform element in plugin.xml instead.
prune c:removeElement  
rebuildWorkspace ws:rebuildWorkspace Although provided, this tag is not generally needed by JET transformations.
removeAttr no direct equivalent  
replaceStrings c:replaceStrings  
roundtrip c:userRegion  
select c:choose JET provides two formats for the <c:choose> tag.
  • One is like the DPTK <select> tag:
    <c:choose select="$element/@kind">
        <c:when test="'FIELD'">
    	    ...
        <c:when>
        <c:when test="'LIST'">
    	    ...
        <c:when>
        ...
    </c:choose>
  • JET also has an if/elseif/else variant, where the 'select' attribute of c:choose is omitted:
    <c:choose>
        <c:when test="$element/@kind = 'FIELD'">
            ...
        </c:when>
        <c:when test="$element/@kind = 'LIST'">
            ...
        </c:when>
        <c:otherwise>
            ...
        </c:otherwise>
    </c:choose>
setAttr c:set  
statusMessage c:log  
start ws:file or java:class DPTK silently adds a Java source folder to the beginning of the 'resource' path, if necessary. The JET ws:file tag does not. The JET java:class tag is Java aware, and has a 'srcFolder' attribute.
stringTokens c:stringTokens  
substring No direct equivalent Use the XPath function substring.
sum No direct equivalent Use the following equivalences:
<sum name="xx" initialize="1"/> <c:setVariable var="xx" select="1"/>
<sum name="xx"/> <c:get select="$xx"/>
<sum name="xx" increment="2"/> <c:setVariable var="xx" select="$xx + 2"/>
targetProject No direct equivalent The XPath variable $org.eclipse.jet.resource.project.name refers to the project containing the input resource. The <ws:...> tags all accept explicit project references in paths.
templateComment <%-- ... --%>  
unique f:unique  
userNode c:setVariable  
workingSet Not supported JET has no tags to create Eclipse working sets.
zilch Not supported Used as an escape mechanism or sometimes a comment. Change tag namespaces using the @taglib directive or use <%-- ... --%> to create comments.

Feedback