Start of Content Area

Background documentation Patterns  Locate the document in its SAP Library structure

When conditional transformations are deserialized, the fact whether the template contents is what is called a pattern is used as a criterion for the assessment. A pattern contains one or more constructs that are used as markers. The most common form of a marker is a literal XML element: if the content of the condition consists of exactly one XML element, then the condition has exactly one positive result if an XML element with this name follows at the current position in the XML input stream.

Marker constructs are:

·        Literal XML element with or without content

·        Non-literal attribute with content

·        Non-empty literal text

·        Explict empty template content

Each of these constructs can be compared with the input stream in an obvious way.

In general, a pattern can contain several markers. For example, sequence

<tt:cond>
  <X> … </X>
</tt:cond>
<Y> … </Y>

is also a pattern; it contains markers <X> and <Y>. A condition with this pattern is determined positively by element X as well as by element Y in the input stream (in the second case, condition is determined negatively with X).

The quantity of the marker constructs M(c) contained in template content c is defined recursively below. Template content c is a pattern if M(c) is not empty. In summary, M(c) consists of the markers that can be used to positively determine pattern c, where conditions in an initial part of c can also be determined negatively.

Some constructs propagate markers externally:

Conditional transformations also propagate markers; with case distinctions and groupings, the union is made in all cases:

For all other instructions c, M(c) is empty.

For ci c2 … sequences of template content, the following applies:

Template content is a pre-pattern if its deserialization is possible without the use of content from the input stream. In detail:

 

Example

The content of the following tt:cond is a pattern with marker elements {f1, f2, f3} (but not fx).

 

<tt:cond s-check="not-initial(F3) and initial(F6)">
  <tt:clear ref="F3"/>
  <tt:cond check="not-initial(F1) or not-initial(F2)">
    <tt:cond check="not-initial(F1)">
      <tt:clear ref="F1"/>
      <tt:serialize>
        <f1 a="v" tt:value-ref="F1"/>
      </tt:serialize>
      <tt:deserialize>
        <f1 tt:value-ref="F1"/>
      </tt:deserialize>
    </tt:cond>
    <f2 tt:value-ref="F2"/>
  </tt:cond>
  <f3 tt:value-ref="F3"/>
  <fx> ... </fx>
</tt:cond>

 

 

 

 

End of Content Area