strings:ReplaceVariables

Previous Next

In an input text, replaces all occurrences of a set of text strings, or matches of regular-expression patterns, by target values. The replacements required are provided as replacement instructions.

Returns the replaced text.

Syntax

strings:ReplaceVariables(
    input-text
,   replace-instruction
   {
       |
       ,   name-attribute-name
       ,   value-attribute-name
       ,   pattern-attribute-name    }
 
)
 
replace-instruction  ::=

 
  <top-level-element>
    <instruction-element   name-attribute  pattern-attribute   value-attribute  />
    <instruction-element   name-attribute  pattern-attribute   value-attribute  />
    ...
   
  </top-level-element>

The required input-text is a regular text string, for example, a SQL statement.

The required replace-instruction is an XML fragment containing a single top-level-element and any number of child instruction-elements. 0 instruction elements is legal but will have no effect.

You can pass input parameters to the replacement routine by using variable references in the replace-instruction.

What each instruction-element must look like depends on whether you are passing name-attribute-name, value-attribute-name and pattern-attribute-name or not. Either NONE of these 3 arguments must be passed, or ALL 3 must be passed as single-quoted string literals, in which case the single-quoted empty string ( '' ) is a valid option.

 

 

collapseSystem-named attributes
collapseUser-named attributes
collapsePattern attributes for substitution based on regular expressions