----- Original Message -----
From: "Geir Magnusson Jr." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 22, 2001 6:21 PM
Subject: Re: escaping characters
> Warner Onstine wrote:
> >
> > Hi all,
> > I'm just hoping there's a better solution to this. I am trying to do
this:
> >
> > #set ($catLink = "<a href='$linkStr'>$category.Name</a>")
> >
> > But, I don't want the href to contain single quotes, but instead double
> > quotes. I've looked through the docs and haven't found anything related
to
> > this.
> >
> > Everything that I've tried so far has either resulted in a bad link or
an
> > error, any help would be appreciated.
> >
> > -warner
>
> I assume you would want to do something like :
>
> #set( $catLink = "<a href=\"$linkStr\">$category.Name</a>" )
>
> ?
After reading the docs that was actually the second thing I tried which
didn't work. I think it would be a nice feature but don't know how much
complexity it adds to the system.
> I am asking because I have been playing with this for a while, but can't
> make up my mind if I like it, and therefore haven't proposed it...
I would say if it isn't going to work that way then the user docs need to be
absolutely clear on that point.
> It solves this problem well, but its another nudge in the direction of
> 'programming', I think... (Like I said, I can't make up my mind about
> this...)
>
> There are other solutions, such as Jon's #macro() approach, or Patrick's
> String.concat()-o-rama.
>
> You could also
>
> #set($dq = '"')
> #set($catlink = "<a href=$dq$linkStr$dq>$category.Name</a>")
Interesting I hadn't thought of that one.
-warner
> and I think for speed, the VM would be fastest over the long term.
>
> --
> Geir Magnusson Jr. [EMAIL PROTECTED]
> System and Software Consulting
> Developing for the web? See http://jakarta.apache.org/velocity/
> Be well, do good work, and keep in touch.
>