logo of XML Sapiens
XML Sapiens Yahoo Group
Join Now
6.3.3.15 Element SAPI:WHEN
Beginning » XML Sapiens v.1.1 Specification » 6. Body of the SAPI Document » 6.3 Data Containers » 6.3.3 Dynamic Data Container (SAPI:DDC) » 6.3.3.15 Element SAPI:WHEN

<!ELEMENT sapi:when (sapi:code?, sapi:comments?, sapi:for-each?, sapi:exp*)>
<!ATTLIST sapi:when -- condition  --
title  %Text   #IMPLIED  -- condition title --
status  %Text   #IMPLIED  -- condition title -
exp  %Text   #IMPLIED  -- condition expression --
>

Start tag: mandatory, End tag: mandatory

Attributes definition

title = %Text [CI]

Recommended. The value of this attribute contains the title of the container condition. The title specifies the container condition title defining the site debugging condition.

status = %Text [CN]

Optional. If an element contains this attribute, its value specifies the status of the container activity.

exp = = %Text [CI]

Optional. This attribute contains condition expressions.

In addition to the condition expression, a condition of a dynamic data container may contain either the SAPI:CODE element or an enumeration handler.

Though a condition expression can be written in one line without characters (<>) that are not allowed for attributes, a condition expression can be placed within the EXP attribute. For example:  

<sapi:when exp="this.this.position==this.this.length">
<sapi:code>HTML…</sapi:code>
</sapi:when>

Otherwise, a condition expression should be specified in the SAPI:EXP element. For example:

<sapi:when title="Main page selection condition "> 
<sapi:exp>('argv[0].value'=='home') OR ('argv[0].value'=='')</sapi:exp>      
<sapi:code>HTML…</sapi:code>
</sapi:when>

6.3.3.15.1 Attribute title

Attributes definition

title = %Text [CI]

Recommended. The value of this attribute contains the container condition title that specifies the condition during site debugging.

6.3.3.15.2 Attribute status

Attributes definition

status = %Text [CN]

Optional. If an element contains this attribute, its value specifies the status of the container activity.

6.3.3.15.3 Attribute exp

Attributes definition

exp = = %Text [CI]

Optional. This attribute contains a condition expression.

This element allows to define condition expressions. A condition is treated as «TRUE» and is processed by the parser only in case its value is «TRUE». Using condition expressions in the syntax of SAPI expressions is allowed (see Objects of SAPI Documents). In certain cases using the syntax of the system language <?SYSTEM … ?>  (see Inclusions of SAPI Documents) is also allowed.

(C) 2004-2006 Red Graphic Systems. All Rights Reserved. Red Graphic Systems liability, trademark, document use and software licensing rules apply. Your interactions with this site are in accordance with our public and Member privacy statements.