Thanks. Unfortunately I don't work directly off of trunk and only pull
down release builds. However, if the replaceAll() statement is removed
then that solves my problem.
Note that Localizer also uses PVI, but doesn't appear to use a
MessageFormat. So Localizer may have been erroneously escaping the '
as well.
On Nov 20, 2007 6:34 PM, Gerolf Seitz <[EMAIL PROTECTED]> wrote:
> thanks for raising this issue.
> the implementation as of 1.3 RC1 is actually wrong (and so are the unit
> tests) :(
> escaping single quotes is necessary for java.text.MessageFormat (which is
> used in StringResourceModel).
> PropertyVariableInterpolator was handling the escaping of single quotes,
> when it clearly shouldn't be, because PVI doesn't know the context it is
> used in.
>
> therefore, i moved the escaping from PropertyVariableInterpolator to
> StringResourceModel (which actually knows about MessageFormat, since it's
> used there) and also updated the unit tests.
>
> can you please try it with the current trunk and report back whether this
> resolved your issue?
>
> Gerolf
>
>
> On Nov 21, 2007 1:39 AM, Mark Sandori <[EMAIL PROTECTED]> wrote:
>
> > Does anyone know why the getValue() method in
> > PropertyVariableInterpolator explicitly escapes all ' into a double '.
> >
> > This is in 1.3 RC1.
> >
> >
> > /**
> > * Retrieves a value for a variable name during interpolation.
> > *
> > * @param variableName
> > * the variable name
> > * @return the value
> > */
> > protected String getValue(final String variableName)
> > {
> > Object value = PropertyResolver.getValue(variableName,
> > model);
> > return value != null ? Strings.replaceAll(value.toString(),
> > "'",
> > "''").toString() : null;
> > }
> >
> > I am trying to use the PropertyVariableInterpolator to interpolate
> > content in a panel I have (instead of using velocity), but I am
> > getting all my ' converted to ''.
> >
> > It seems that Localizer and StringResourceModel are the only places
> > that use PropertyVariableInterpolator. Hopefully, they compensate for
> > this somehow...
> >
> > Any thoughts?
> >
> > Thanks,
> > Mark.
> >
>