For the content precond of attribute using of an element tt:cond, you can specify the following preconditions. The operand of the precondition can be a data node specified in the form dnode.
Precondition |
Description |
exist(dnode) |
Met if an ABAP data object is bound to the node |
type-C(dnode) |
Met if an ABAP data object is bound to the node, which is of type c |
type-D(dnode) |
Met if an ABAP data object is bound to the node, which is of type d |
type-F(dnode) |
Met if an ABAP data object is bound to the node, which is of type f |
type-I(dnode) |
Met if an ABAP data object is bound to the node, which is of type i |
type-N(dnode) |
Met if an ABAP data object is bound to the node, which is of type n |
type-P(dnode) |
Met if an ABAP data object is bound to the node, which is of type p |
type-T(dnode) |
Met if an ABAP data object is bound to the node, which is of type t |
type-X(dnode) |
Met if an ABAP data object is bound to the node, which is of type x |
The element X is considered during a serialization only if the ABAP data object bound to ROOTis of type c.
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="ROOT"/>
<tt:template>
<tt:s-cond
using="type-C(ref('ROOT'))">
<X>
...
</X>
</tt:s-cond>
</tt:template>
</tt:transform>
Instead of "type-C(ref('ROOT'))" you could also write "type-C(ROOT)".
You can specify a precondition as a list of several of the above preconditions, separated by commas. Such a precondition is met if all preconditions in the list are met. Within the list, every data node may appear only once.
The element X is considered during a serialization only if the ABAP data object bound to ROOT1is of type i and the ABAP data object bound to ROOT2 is of type f.
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root
name="ROOT1"/>
<tt:root
name="ROOT2"/>
<tt:template>
<tt:s-cond
using="type-I(ROOT1), type-F(ROOT2)">
<X>
...
</X>
</tt:s-cond>
</tt:template>
</tt:transform>