RE: how to create a dollar sign?

"Ralf Hauser" <[email protected]> Mon, 22 Dec 2003 07:43:27 +0100
Newsgroups gmane.comp.text.fmpp
Message-ID <[email protected]>
Daniel,

Thanks a lot,

> -----Original Message-----
> From: Daniel Dekany [mailto:[email protected]]
...
> > As per
> >
> http://freemarker.org/docs/dgui_template_exp.html#dgui_template_ex
> p_direct_s
> > tring
> > I am trying to create a dollar sign.
> >
> > if \xA9 is a copyright, \x24 should be dollar,
> >
> > but how do I make this appear in the output, just including
> this in ftl file
> > doesn't do?
> > <#assign dollar>\xA9</#assign>
> > ${dollar}
> >  ${\xA9}
> >
> > Any hints would be highly appreciated!
>
> These escapes work only in string literals. Like in Java Language or C
> or Perl, etc. But why do you want to escape $? If you want this in the
> output:
>
> A interpolation looks like this: ${moo}
>
> then write:
>
> <#noparse>A interpolation looks like this: ${moo}</#noparse>
>
> or
>
> A interpolation looks like this: ${'$'}{moo}
>
> You almost never have to escape dollar. Also note that dollar in itself
> is not reserved in FTL. Only '${'.
It is used for a combination of xml and ftl:
   ${'$'}{${sect.@idS}Tit}
as per your suggestion works nicely to produce "${GenQ_SectTit}" since
idS="GenQ_Sect", similarly, also
   <#noparse>$</#noparse>{${sect.@idS}Tit}
works, but it is so verbose...

Thx Ralf

P.S.: my posting yesterday got held up for "moderator approval" have you
changed the policy on the forum?



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click