Escape sequence

This document describes the escape syntax to use to specify literal strings for strings with XAL-specific uses and which the parser thus interprets as XAL-specific syntax when not escaped.

Various syntax throughout the range of XAL expressions requires escaping for the syntax to be used as literals.

Method Parameters

In the syntax you use to specify method parameters in a declarative method call, you must escape the following:

  • In a string surrounded by double quotes:
    - To include a freestanding " (double quote), use \"  
    - To include a freestanding \ (backslash), use \\
  • In a string surrounded by single quotes.
    - To include a freestanding ' (single quote) use \'
    - To include a freestanding \ (backslash), use \\

Resolution Syntax 

In UI documents, you can specify placeholders for entire attributes or text nodes and then use method calls to resolve the placeholders with actual text.

You create these placeholders using text resolution syntax, {...}.

Because {  } (curly brackets) now have special meaning, you must use an escape syntax to specify these characters as literals in an attribute or text node. The following table shows the escape syntax to use in an attribute or text node:

SyntaxEscape Syntax
{\{
}

\}

\\\

For example, for button text to appear as: "{helllo}" without Nexaweb interepreting that text as a resolved value, you enter the following:

<button text="\{hello\}" />