DIML Test Page

Perl Implementation

System variable calls

<%%ESSI::OUTPUT_TYPE%%> : "text/html"
<%%ESSI::TEMPLATE_PATH%%> : "/home/project-web/diml/htdocs/support/test"
<%%ESSI::INVOKE_PATH%%> : ""
<%%ESSI::VERSION%%> : "MULTI 3.1_001_nocache 08/01/2005"
<%%ESSI::AUTHOR%%> : "V. FREMAUX"

CGI variable calls

<%%FORM::session%%> : ""

Simple template declaration

<TEMPLATE ID="aTemplate">
a template declaration
</TEMPLATE>
<%%aTemplate%%> : "
a template declaration
"
Syntax tolerance <% %aTemplate% %> : "
a template declaration
"

Template exotic namings

<TEMPLATE ID="FUNCTION()">
a special "function-like" naming
</TEMPLATE>
 
<%%FUNCTION()%%> : "
a special "function-like" naming
"

<TEMPLATE ID="MULTIPLE::SCOPED::VARIABLE">
a "scoped" naming
</TEMPLATE>
 
<%%MULTIPLE::SCOPED::VARIABLE%%> : "
a "scoped" naming
"

<TEMPLATE ID="BUZZY-š¨^%ú$">
somewhat strange, is'nt it ?
</TEMPLATE>
 
<%%BUZZY-š¨^%ú$%%> : "
somewhat strange, is'nt it ?
"

Simple variable call modifiers

<TEMPLATE ID="aTemplateTooLong" INLINE>
a template declaration wich is too long to fit into available space
</TEMPLATE>
 
<TEMPLATE ID="aTemplateTooShort" INLINE>
zip!
</TEMPLATE>
 
<%%aTemplateNull DEFAULT="No Value"%%> : "No Value"
<%%aTemplateTooLong MAXLENGTH="20"%%> : "a template declarati..."
<%%aTemplateTooShort MINLENGTH="20"%%> : "zip!                "

Inline template declaration

<TEMPLATE ID="aTemplateInline" INLINE>
a template declaration
</TEMPLATE>
<%%aTemplateInline%%> : "a template declaration"

Static template declaration

<TEMPLATE ID="aTemplateStatic" STATIC>
a template declaration holding <%%VARIABLE%%>
</TEMPLATE>
<TEMPLATE ID="aTemplateNonStatic">
a template declaration holding <%%VARIABLE%%>
</TEMPLATE>
 
<%set %VARIABLE% = "variables" %> 
<%%aTemplateStatic%%> : "
a template declaration holding 
"
<%set %VARIABLE% = "other variables" %> 
<%%aTemplateStatic%%> : "
a template declaration holding 
"
 
</TEMPLATE><%set %VARIABLE% = "variables" %> 
<%%aTemplateNonStatic%%> : "
a template declaration holding variables
"
<%set %VARIABLE% = "other variables" %> 
<%%aTemplateNonStatic%%> : "
a template declaration holding other variables
"

Variable set and eval initializers

Set/Eval data names

<%set %simpleVar% = "adata" %>
<%%simpleVar%%> = "adata"
 
<%set %_underscored% = "underscore" %>
<%%_undescored%%> = "underscore"
 
<%set %@exotic!?-{}% = "is this really usefull ?" %>
<%%@exotic!?-{}%%> = "is this really usefull ?"
 
<%set %functionLike()% = "afunction" %>
<%%functionLike()%%> = "afunction"
 
<%set %SCOPE::scoped% = "a scoped var" %>
<%%SCOPE::scoped%%> = "a scoped var"
 
<%eval %simpleVar% = "evaluated adata" %>
<%%simpleVar%%> = "evaluated adata"
 
<%eval %dynamicVar% = "this is a &lt;%%simpleVar%%&gt;" %>
<%%dynamicVar%%> = "this is a evaluated adata"
 
<%eval %_underscored% = "this is an evaluated &lt;%%_underscored%%&gt;" %>
<%%_undescored%%> = "this is an evaluated underscore"

Setting/Evaluating to empty string

<%set %simpleVar% = "" %>
<%%simpleVar%%> = ""

<%eval %_underscored% = "" %>
<%%_underscored%%> = ""

Set/Eval effect

<%set %embedded% = "embedded and escaped" %>
<%set %NewSetVariable% = "a new variable that contains &lt;%%embedded%%&gt; calls" %>
<%eval %NewEvaluatedVariable% = "a new variable that contains &lt;%%embedded%%&gt; calls" %>
 
<%%embedded%%> : "embedded and escaped"
<%%NewSetVariable%%> : "a new variable that contains embedded and escaped calls"
<%%NewEvaluatedVariable%%> : "a new variable that contains embedded and escaped calls"
<%set %embedded% = "changed content" %>
<%%NewSetVariable%%> : "a new variable that contains changed content calls"
<%%NewEvaluatedVariable%%> : "a new variable that contains embedded and escaped calls"

Simple vector operations

Simple vector finite iteration

<%set %TABLE1ž0% = "zero" %>
<%set %TABLE1ž1% = "one" %>
<%set %TABLE1ž2% = "two" %>
<%set %TABLE1ž3% = "three" %>
<%set %TABLE1ž4% = "four" %>
<%set %TABLE1ž5% = "five" %>
 
<TEMPLATE ID="SIMPLE_SCAN" INLINE>
"<%%TABLE1[]%%>" 
</TEMPLATE>
 
<%%SIMPLE_SCAN[4]%%> = ""zero" "one" "two" "three" "

Offset table access

<%%TABLE1žI%%> : "4" (from last test)
<%%TABLE1[]%%> : "four" 
<%%TABLE1[-1]%%> : "three" 
<%%TABLE1[+1]%%> : "three" 

Table access via indirection

<%set %INDIRECTION% = "3" %>
<%%TABLE1[%INDIRECTION%]%%> : "three" 

Cursor movement operations

<%%TABLE1žI%%> : "4" (from last test)
<%rewind %TABLE1% %>
<%%TABLE1žI%%> : "0"
<%next %TABLE1% %>
<%%TABLE1žI%%> : "1"
<%next %TABLE1% %>
<%%TABLE1žI%%> : "2"
<%back %TABLE1% %>
<%%TABLE1žI%%> : "1"
<%back %TABLE1% %>
<%%TABLE1žI%%> : "0"

Simple vector indefinite iteration

<%rewind %SIMPLE_SCAN% %>
<%%SIMPLE_SCANžI%%> : "0"
<%set %SIMPLE_SCANžC% = "6" %>
<%%SIMPLE_SCAN[*]%%> = ""zero" "one" "two" "three" "four" "five" "

Matrix operations

Matrix iteration (table scan)

<%set %TABLEž0ž0% = "A0" %>
<%set %TABLEž1ž0% = "A1" %>
<%set %TABLEž2ž0% = "A2" %>
<%set %TABLEž3ž0% = "A3" %>
<%set %TABLEž4ž0% = "A4" %>
<%set %TABLEž0ž1% = "B0" %>
<%set %TABLEž1ž1% = "B1" %>
<%set %TABLEž2ž1% = "B2" %>
<%set %TABLEž3ž1% = "B3" %>
<%set %TABLEž4ž1% = "B4" %>
<%set %TABLEž0ž2% = "C0" %>
<%set %TABLEž1ž2% = "C1" %>
<%set %TABLEž2ž2% = "C2" %>
<%set %TABLEž3ž2% = "C3" %>
<%set %TABLEž4ž2% = "C4" %>
<%set %TABLEž0ž3% = "D0" %>
<%set %TABLEž1ž3% = "D1" %>
<%set %TABLEž2ž3% = "D2" %>
<%set %TABLEž3ž3% = "D3" %>
<%set %TABLEž4ž3% = "D4" %>
<%set %TABLEž0ž4% = "E0" %>
<%set %TABLEž1ž4% = "E1" %>
<%set %TABLEž2ž4% = "E2" %>
<%set %TABLEž3ž4% = "E3" %>
<%set %TABLEž4ž4% = "E4" %>
 
<TEMPLATE ID="ROWS" INLINE>
<%%CELLS[4]%%>
 
</TEMPLATE>
 
<TEMPLATE ID="CELLS" INLINE>
"<%%TABLE[][]%%>" 
</TEMPLATE>
 
<%%ROWS[4]%%> = "
"A0" "A1" "A2" "A3" 
"B0" "B1" "B2" "B3" 
"C0" "C1" "C2" "C3" 
"D0" "D1" "D2" "D3" 
"

Offset table access

<%%TABLEžI%%> : "0" (from last test)
<%%TABLEžIžI%%> : "4" (from last test)
<%%TABLE[][]%%> : "E0" 
<%%TABLE[-1][-1]%%> : "" 
<%%TABLE[+1][+1]%%> : "" 

Cursor movement operations (unbounded table)

<%%TABLEžI%%> : "0" (from last test)
<%%TABLEžIžI%%> : "4" (from last test)
<%rewind %TABLE% %>
<%%TABLEžI%%> : "0"
<%%TABLEžIžI%%> : "0"
<%next %TABLE% %>
<%%TABLEžI%%> : "1"
<%%TABLEžIžI%%> : "0"
<%next %TABLE% %>
<%%TABLEžI%%> : "2"
<%%TABLEžIžI%%> : "0"
<%next %TABLE% %>
<%%TABLEžI%%> : "3"
<%%TABLEžIžI%%> : "0"
<%next %TABLE% %>
<%%TABLEžI%%> : "4"
<%%TABLEžIžI%%> : "0"
<%next %TABLE% %>
<%%TABLEžI%%> : "5"
<%%TABLEžIžI%%> : "0"
<%back %TABLE% %>
<%%TABLEžI%%> : "4"
<%%TABLEžIžI%%> : "0"
<%back %TABLE% %>
<%%TABLEžI%%> : "3"
<%%TABLEžIžI%%> : "0"
<%back %TABLE% %>
<%%TABLEžI%%> : "2"
<%%TABLEžIžI%%> : "0"
<%back %TABLE% %>
<%%TABLEžI%%> : "1"
<%%TABLEžIžI%%> : "0"
<%back %TABLE% %>
<%%TABLEžI%%> : "0"
<%%TABLEžIžI%%> : "0"

Cursor movement operations (bounded table)

<%set %TABLEžC% = "4" %>
<%set %TABLEžCžC% = "4" %>
 
<%%TABLEžI%%> : "0" (from last test)
<%%TABLEžIžI%%> : "0" (from last test)
<%rewind %TABLE% %>
<%%TABLEžI%%> : "0"
<%%TABLEžIžI%%> : "0"
<%next %TABLE% %>
<%%TABLEžI%%> : "1"
<%%TABLEžIžI%%> : "0"
<%next %TABLE% %>
<%%TABLEžI%%> : "2"
<%%TABLEžIžI%%> : "0"
<%next %TABLE% %>
<%%TABLEžI%%> : "3"
<%%TABLEžIžI%%> : "0"
Should wrap around dimensions
<%next %TABLE% %>
<%%TABLEžI%%> : "0"
<%%TABLEžIžI%%> : "1"
<%next %TABLE% %>
<%%TABLEžI%%> : "1"
<%%TABLEžIžI%%> : "1"
<%back %TABLE% %>
<%%TABLEžI%%> : "0"
<%%TABLEžIžI%%> : "1"
<%back %TABLE% %>
<%%TABLEžI%%> : "4"
<%%TABLEžIžI%%> : "0"
<%back %TABLE% %>
<%%TABLEžI%%> : "3"
<%%TABLEžIžI%%> : "0"
<%back %TABLE% %>
<%%TABLEžI%%> : "2"
<%%TABLEžIžI%%> : "0"
<%back %TABLE% %>
<%%TABLEžI%%> : "1"
<%%TABLEžIžI%%> : "0"

LOL operations (list of lists)

Conditional statements

One shot instructions

<%if (%avar0% eq "true") "single" %endif %> : ""
<%set %avar0% = "true" %>
<%if (%avar0% eq "true") "single" %endif %> : "single"
 
<%set %encapsed% = "single with injection" %>
<%if (%avar0% eq "true") "&lt;%%encapsed%%&gt;" %endif %> : "single with injection"
 
<%if (%avar1% eq "true") "first" %else "second" %endif %> : "second"
<%set %avar1% = "true" %>
<%if (%avar1% eq "true") "first" %else "second" %endif %> : "first"
 
<%set %var_if% = "this is if" %>
<%set %var_else% = "this is else" %>
<%if (%avar2% eq "true") %var_if% %else %var_else% %endif %> : "this is else"
<%set %avar2% = "true" %>
<%if (%avar2% eq "true") %var_if% %else %var_else% %endif %> : "this is if"

Multiline instructions

<%if (%avar3% eq "true") %>
first multiline
<%else %>
second multiline
<%endif %> : "second multiline"
<%set %avar3% = "true" %>
Same expression as above : "first multiline"

Nested Multiline instructions

<%if (%avar4% eq "true") %>
first multiline
<%else %>
   <%if (%avar5% eq "true") %>
   first second multiline
   <%else %>
   second second multiline
   <%endif %>
<%endif %>> : "second second multiline"
<%set %avar4% = "true" %>
Same expression as above : "first multiline"
<%set %avar4% = "" %>
<%set %avar5% = "true" %>
Same expression as above : "first second multiline"

Template imports

<%template file="externalTemplates.dim#external1" %>
<%template file="externalTemplates.dim#external1" %> : "
external 1 template
"
<%%external1%%> : "
external 1 template
"
<%%external2%%> : ""
 
<%import file="externalTemplates.dim#o*" %>
<%%otherExternal1%%> : "
alternate external 1 template
"
<%%external2%%> : ""
 
<%import file="externalTemplates.dim#*" %>
<%%otherExternal1%%> : "
alternate external 1 template
"
<%%external2%%> : "
external 2 template
"

Overscripting invokations

<%%newvar%%> : ""
<%invoke script="overscript.php" %>
<%%newvar%%> : "a new variable brought from an additional script"

Time Calculation benching

Os was :