Changes between Version 13 and Version 14 of Doc/panc/dml/functions
- Timestamp:
- May 15, 2007, 2:32:46 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Doc/panc/dml/functions
v13 v14 138 138 139 139 This function checks if the ”variable expression” (see delete function) corresponds to an existing 140 element. 140 element. '''Note that this function processes its argument in a non-standard way. The function only checks to see if the element identified by the variable expression exists. It does not check the actual value of the element. Consequently, this function will return true for any element including 'null' and 'undef' values.''' 141 141 142 142 === exists( path:string ) : boolean === 143 143 144 This function checks if the path corresponds to an existing element. 144 This function checks if the path corresponds to an existing element. '''Note that if the argument is a variable expression it will be interpreted as a call to exists( arg:variable) and will not read the value of the variable.''' For example, the following DML code: 145 {{{ 146 v = '/some/absolute/path'; 147 r = exists(v); 148 }}} 149 always gives the value 'true' to the variable r. If you want to test the path, do something like the following instead: 150 {{{ 151 v = '/some/absolute/path'; 152 r = exists(v+''); 153 }}} 154 Here the value r will depend on whether the path '/some/absolute/path' actually exists. 145 155 146 156 === exists( template:string ) : boolean === 147 157 148 This function checks if the given template exists. 158 This function checks if the given template exists. '''Note that this function processes its arguments in a non-standard way. The argument must be a bare template name; the template must not be specified by a string.''' 149 159 150 160 === first( arg:resource, key:identifier, value:identifier ) : boolean ===