The lack of a switch token sometimes results in unnecessary large code statements, because of the limitations of a do-if token. It would be nice if DirXML script would add support for a switch token. I.E.:

<do-switch>
<arg-conditions>
<and>
<if-op-attr mode="nocase" name="Given Name" op="equal">fred</if-op-attr>
</and>
</arg-conditions>
<arg-actions>
<do-add-dest-attr-value name="Surname">
<arg-value type="string">
<token-text>Flintstone</token-text>
</arg-value>
</do-add-dest-attr-value>
</arg-actions>
<arg-conditions>
<and>
<if-op-attr mode="nocase" name="Given Name" op="equal">barney</if-op-attr>
</and>
</arg-conditions>
<arg-actions>
<do-add-dest-attr-value name="Surname">
<arg-value type="string">
<token-text>Rubble</token-text>
</arg-value>
</do-add-dest-attr-value>
</arg-actions>
<arg-conditions>
<and/>
</arg-conditions>
<arg-actions>
<do-add-dest-attr-value name="Surname">
<arg-value type="string">
<token-text>Unknown</token-text>
</arg-value>
</do-add-dest-attr-value>
</arg-actions>
</do-switch>

Comments