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.
>

Reply via email to