sdd message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: Variable expressions and conditions
- From: Christine Draper <cdraper@us.ibm.com>
- To: sdd@lists.oasis-open.org
- Date: Thu, 12 Oct 2006 10:13:47 -0400
All,
This is what we had in the original IUDD V1 spec for variable expression and conditions. I propose we adopt these definitions (although we need to clarify that variables can be nested, and if this can be to arbitrary depth).
Variable Expressions
Some elements of the IUDD schema are instances of base:VariableExpression. The latter is a simple XML type derived by restriction from the XML base string type:
<simpleType name="VariableExpression">
<restriction base="token">
<pattern value="([^$]*($[^(])*($\([a-zA-Z_]+[0-9a-zA-Z_]*\))*)*"/>
</restriction>
</simpleType>
The restriction forces the substring “xxxx” contained within an enclosing substring “$(xxxx)” to be a valid variable identifier, as defined by the type NCName.
The consumer of an element that is an instance of the base:VariableExpression type MUST resolve the variables in the string and substitute each “$(xxxx)” token appearing in the variable expression with the value of the corresponding variable.
Conditional Expressions
A conditional expression MAY appear as the value of a condition attribute in the following schema elements within the IUDD:
- An expression element, defined within the derivedVariable element of a variable definition, see Section 8.1.2;
- An installable unit definition within the base or selectable content of the root IU, see Section 6;
- A unit element within an SIU or CU defining an artifact set, see Section 9.3.
Conditional expressions also appear in artifacts where they are used to condition actions and action groups, see Section C.
Check variables, property queries and derived variables based on property queries MAY be used in conditions. The use of parameters is permitted but discouraged, as a condition is intended to represent an environmental constraint and not a user selection. Resolved target lists and IU discriminant variables SHOULD NOT be used in conditions.
A condition element is an instance of base:VariableExpression, see Section 8.2. Once variable substitution has occurred in a condition, the resulting conditional expression MUST be a (constant) XPath boolean expression, with the following restrictions:
- When all the variable substitutions have been completed, the string value of a condition element must be a valid XPath boolean expression. The format of the XPath expressions is defined by the XML Path Language (XPath) Version 1.0 (http://www.w3.org/TR/xpath).
- The boolean expression to which the condition element reduces after variable substitutions SHOULD NOT contain any of the following:
- Variables References
- Node Sets Expressions, including functions returning a node set.
- Function calls.
These constraints SHOULD be enforced by the tooling and validated by the installer.
condition="('$(win_drive)' != 'C:') and ('$(win_drive)' != 'Z:')"
Note that string literals can appear within single quotes if the conditional expression attribute is enclosed within double quotes, and vice versa. Note that operators like “<” and “>” cannot be directly typed within the conditional expression and MUST be escaped by, for example using < and > respectively. Syntax details are described at http://www.w3.org/TR/xpath.
Regards,
Christine
Senior Technical Staff Member
IBM, 11501 Burnet Road, Mail Point 901-6B10
Austin, TX 78758
1-512-838-3482 tl 678-3482
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]