Start of Content Area

Syntax documentation Controlling the Extensibility of Literal XML Elements  Locate the document in its SAP Library structure

During deserialization, XML elements in the input stream that are not specified in the ST program normally result in an error. If the processed XML format should be extended, elements that are not specified explicitly can be passed over without further processing by specifying optional attribute tt:extensible. The attribute can accept the following values:

 

... ″on|deep-static|deep-dynamic|off|deep-off″ ...

 

The value on states that the current element may have direct subelements that are not explicitly specified. This is the standard setting. Values deep-static and deep-dynamic state that the current element and its subelements can be extended. With the value off, the extensibility is deactivated for the current element but not its subelements. In other words, it cannot be extended by direct subelements, although its (specified) subelements can be. The value deep-off switches off extensibility for the current element and its subelements. These settings can be overwritten locally in individual subelements.

Values deep-static and deep-dynamic have different areas of validity: deep-static only has an effect within the part of the program in which it is set; deep-dynamic is effective across template calls using tt:apply and tt:call.

The deep extensibility that is configured using deep-static and deep-dynamic also takes effect in case distinctions using tt:switch and grouping using tt:group by skipping unexpected elements that are not covered by a case.

Example

This example shows that extensibility together with optional elements (such as elements that are only deserialized when a condition occurs) causes problems as generally the extensibility means that such optional elements are not found. For example, the following section of program

 

<r tt:extensible="on">
  <tt:cond> <a tt:value-ref="A"/> </tt:cond>
  <b tt:value-ref="B"/>
</r>

with the input stream

 

 <r> <x/> <a>1</a> <b>2</b> </r>

 

would not result in the deserialization A=1 as the unexpected element x determines the condition negatively using a. Both x and a are skipped as "extension elements" are only mandatory element b is deserialized as B=2. The problem can be solved by using tt:group, although this also resolves the sequence of a and b:

<r tt:extensible="on">
  <tt:group>
    <tt:cond frq="?"> <a tt:value-ref="A"/> </tt:cond>
    <tt:cond>         <b tt:value-ref="B"/> </tt:cond>
  </tt:group>
</r>

 

 

End of Content Area