SAPID Encyclopedia  
Sapid   SAPID-Club (English, Russian, Portuguese forums) SAPID-Workshop (Project and developer charts) SAPID-Wiki (SAPID Live Encyclopedia) SAPID-Farm (The best place for a SAPID-based project)
Download
eXTReMe Tracker
HomeDocumentationXML Sapiens Hand-bookXML Sapiens Expressions

XML Sapiens Expressions

XML Sapiens expressions can be used to describe the logic of functional solutions in dynamic data containers. While developing the expression operands the constructions of the XML script language XEXPR (http://www.w3.org/TR/2000/NOTE-xexpr-20001121/) where used. The XML Sapiens specification supports expressions of comparison. There expressions can return one of the two values (0 or1), meaning respectively either FLASE or TRUE

In the content of attributes XML Sapiens specification allows the following expression operands:

lt(A, B, C) (less), leq(A, B, C) (less or equal), geq(A, B, C) (more or equal), eq(A, B, C) or == (equal), neq(A, B, C) or != (not equal), gt(A, B, C) (more). A B C – values, separated by commas. For grouping the expressions, it is allowed to use round brackets, and logic operands as well: and(A, B, C) or AND(A, B, C) and or(A, B, C) or OR(A, B, C).

It is also allowed to use mathematic operands: add(A, B, C) or + (add – for numerals, merge – for strings), subtract(A, B, C) or – (substraction), multiply(A, B, C) or * (multiplication), divide(A, B, C) (division).

XML Sapiens expressions allow direct reference CMS environment variables. E.g.:

<sapi:for-each select="get_tree()" >
<sapi:choose>
<sapi:when exp="neq(this.variable.value, last_argv.value)">
<sapi:code>
<a href="../../../../">
<sapi:apply select="this.this.title.value" />
</a>
</sapi:code>
</sapi:when>
</sapi:choose>
</sapi:for-each>

The expressions can be used in the EXP attribute of the SAPI:WHEN element, in the SELECT attribute of the SAPI:FOR-EACH element, in the EXP attribute of the SAPI:APPLY element or in the attributes of SAPI:%Attrib format

If it is necessary to get the executive result of the XML Sapiens expression, the following sytaxis can be used in container code (SAPI:CODE element)

<sapi:apply exp="add(http_path.value, qc.link.value)" />

 



User Contributed Notes

January 01, 1970 00:00
Add a note

Your email address/name
Your notes
Red Graphic Systems Sponsored