ChiTec
ChiTec

Reputation: 163

Escaping curly braces in XML

I cannot find the answer for this question.

I read that doubling the bracket should help so something like

<node>http://test.com?test={{0}}</node>

But it didn't

Upvotes: 5

Views: 14531

Answers (3)

jason schutz
jason schutz

Reputation: 31

& #123; Left curly brace            { //--------------> Left Side
//---------------------------------------------------------------//              |
& #125; Right curly brace           } //--------------> Right Side

This should be a nice one to save and save for later. I've got this saves in .pdf and stored in my iBooks on the phone.

**The ampersand has been spaced from the code so it can display in a row here. The Space will need to be removed between the ampersand and the pound sign for it to work. **



Code    Name           Displayed    as
& #09;  Horizontal     tab          non-printing
& #10;  Line           feed         non-printing
& #13;  Carriage       Return       non-printing
& #32;  Space                       non-printing
& #33;  Exclamation    mark         !
& #34;  Quotation      mark         "
& #35;  Number         sign         #
& #36;  Dollar         sign         $
& #37;  Percent        sign         %
& #38;  Ampersand                   &
& #39;  Apostrophe                  '
& #40;  Left           parenthesis  (
& #41;  Right          parenthesis  )
& #42;  Asterisk                    *
& #43;  Plus           sign .       +
& #44;  Comma                       ,
& #45;  Hyphen                      -
& #46;  Period                      .
& #47;  Slash                       /
& #58;  Colon                       :
& #59;  Semi-colon                  ;
& #60;  Less than                   
& #63;  Question mark               ?
& #64;  At                          @
& #91;  Left square bracket         [
& #92;  Bbackslash                  \
& #93;  Right square bracket        ]
& #94;  Caret                       ^
& #95;  Underscore                  _
& #96;  Acute accent                `
& #123; Left curly brace            { //--------------> Left Side
& #124; Vertical bar                |
& #125; Right curly brace           } //--------------> Right Side
& #126; Tilde                       ~


Upvotes: 3

mamoo
mamoo

Reputation: 8166

Curly brackets should be escaped only when inside attributes of an XSLT.

Upvotes: 2

James
James

Reputation: 82096

You shouldn't need to escape the } character. See this question for the characters that need escaped in XML.

Upvotes: 7

Related Questions