We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

How to assign a string having ' using expr in <var> tag

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
vikas
Posts: 53
Joined: Wed May 13, 2015 7:46 pm

How to assign a string having ' using expr in <var> tag

Post by vikas »

I am getting error when executing below <var> statement. Error is due to ' in the word S'il
<var name="Verbiage3" expr="' S'il vous plait veuillez saisir les 16 numeros digitaux de votre carte suivis de diese '"/>

The String getting assigned is in French language which makes use of ' at many places.
I have tried using escape sequence for ' (' and &apos;) but that doesn't seem to be working.

Exact error that I see in log is "missing ; before statement line 1 SyntaxError: missing ; before statement line 1"
How do I fix this error?

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: How to assign a string having ' using expr in <var> tag

Post by support »

Hi,

You should be able to escape the single quote with a backslash like such:

<var name="Verbiage3" expr="' S\'il vous plait veuillez saisir les 16 numeros digitaux de votre carte suivis de diese '"/>

We put together a sample that uses this assignment and reads it back in French and it sounded as it should:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.1">

<form>
  <block>
    <var name="Verbiage3" expr="' S\'il vous plait veuillez saisir les 16 numeros digitaux de votre carte suivis de diese '"/>
    <prompt><speak xml:lang="FR-fr">
      <value expr="Verbiage3"/></speak>
    </prompt>
  </block>
</form>
</vxml>
Please let us know if you have any questions.

Regards,
Plum Support

vikas
Posts: 53
Joined: Wed May 13, 2015 7:46 pm

Re: How to assign a string having ' using expr in <var> tag

Post by vikas »

Thanks. That worked.

However I noticed that you have used "xml:lang="FR-fr". But using the below link I was assuming it to be "xml:lang="fr-FR".
Does it matter? or both will work same way for Real Speak Engine?

French (fr-FR)
http://www.plumvoice.com/docs/dev/devel ... erence:tts

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: How to assign a string having ' using expr in <var> tag

Post by support »

Hi,

It appears to work with both. We just put together a quick sample as a proof of concept and the FR-fr was just a typo. We would suggest sticking with the format of the documentation (fr-FR), as that's always the preferred, supported format.

Regards,
Plum Support

Post Reply