I'm working with the XMLTemplater and would like to know if it's possible to conditionally process subtemplates.
ie if attr1 = "a" then {fme:process-template("X")} else {fme:process-template("Y")}
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
I found this description and example in the help doc of the XMLTemplater ;)
---
A common use case is to write out an XML element only if a feature attribute has a value. To do this, an if-then-else statement is used. The following example writes out the displayName element only if the feature contains a display_name attribute, and value of the attribute is not an empty string.
<road>
{ if( fme:has-attribute("display_name") and
not(fme:get-attribute("display_name") eq "") )
then <displayName>{fme:get-attribute("display_name")}</displayName>