Show TOC

Syntax documentationPreconditions Locate this document in the navigation structure

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.

State Queries

Precondition

Meaning

exist(dnode)

Met if an ABAP data object is bound to the node

type-C(dnode)

Met if an ABAP data object of type c is bound to the node

type-D(dnode)

Met if an ABAP data object of type d is bound to the node

type-F(dnode)

Met if an ABAP data object of type f is bound to the node

type-I(dnode)

Met if an ABAP data object of type i is bound to the node

type-N(dnode)

Met if an ABAP data object of type n is bound to the node

type-P(dnode)

Met if an ABAP data object of type p is bound to the node

type-T(dnode)

Met if an ABAP data object of type t is bound to the node

type-X(dnode)

Met if an ABAP data object of type x is bound to the node

Example

The element X is considered during serialization only if the ABAP data object bound to ROOT is of type c.

Syntax Syntax

  1. <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
  2.   <tt:root name="ROOT"/>
  3.   <tt:template>
  4.     <tt:s-cond using="type-C(ref('ROOT'))">
  5.       <X>
  6.         ...
  7.       </X>
  8.     </tt:s-cond>
  9.   </tt:template>
  10. </tt:transform>
  11.  
End of the code.

Instead of "type-C(ref('ROOT'))", you could also write "type-C(ROOT)".

Linking Several Preconditions

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.

Example

The element X is considered during serialization only if the ABAP data object bound to ROOT1 is of type i and the ABAP data object bound to ROOT2 is of type f.

Syntax Syntax

  1.  
  2. <tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
  3.   <tt:root name="ROOT1"/>
  4.   <tt:root name="ROOT2"/>
  5.   <tt:template>
  6.     <tt:s-cond using="type-I(ROOT1), type-F(ROOT2)">
  7.       <X>
  8.         ...
  9.       </X>
  10.     </tt:s-cond>
  11.   </tt:template>
  12. </tt:transform>
End of the code.