util::var_subst_quotehtml (public)
util::var_subst_quotehtml [ -ulevel ulevel ] string
Defined in packages/acs-tcl/tcl/utilities-procs.tcl
Substitute in the provided string all variables with their values (like "subst -nobackslashes -nocommands ..."), and perform HTML quoting on the variable values before substitution. This command supports Tcl array syntax, and Tcl scalar variables with and without curly braces.
- Switches:
- -ulevel (optional, defaults to
"1"
)- Where we should uplevel to when doing the subst's. Defaults to '1', meaning the caller's scope.
- Parameters:
- string (required)
- Author:
- Gustaf Neumann
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: # # Protect evaluation characters # set escaped [string map {[ \\[ ] \\] \\ \\\\} $string] # # Handle array syntax: # regsub -all -- {\$([0-9a-zA-Z_:]*[\(][^\)]+[\)])} $escaped {[ns_quotehtml [set \1]]} escaped # # Handle plain variables: # regsub -all -- {\$([0-9a-zA-Z_:]+|[\{][^\}]+[\}])} $escaped {[ns_quotehtml $\1]} result # # Finally, "subst" the result. # return [uplevel $ulevel [list ::subst $result]]XQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/utilities-procs.xql