![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Escape { and } characters in config file [Thread Next] Re: Escape { and } characters in config fileTo: NULL Date: 7/5/2006 1:37:00 PM
Lonifasiko wrote:
> String.Format(ConfigurationManager.AppSettings["Javascript"], "6) //
> Want to insert "6" value
>
> I've got this in my .config file:
>
> <add key ="Javascript" value="function GetKey(){key = new
> Key('myKey'){0};var i = 'jjj';} " />
> But
> another problem has now appeared: don't like both { and } characters.
>
> How can I escape { and } characters?
With XML the characters '{' and '}' do not have any special meaning and
do not need to be escaped.
However for the String.Format method the '{' and '}' have special
meaning and need to be escaped as '{{' and '}}'.
So your config XML should look like
<add key="Javascript"
value="function GetKey(){{key = new Key('myKey'){0};var i = 'jjj';}} " />
assuming the {0} is a parameter for String.Format and should have
special meaning. Otherwise you need to escape that too.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
