开发者

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


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


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


& #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                       ~


0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜