Page 1 of 1

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

Posted: Fri Nov 13, 2015 3:03 pm
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?

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

Posted: Fri Nov 13, 2015 3:39 pm
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

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

Posted: Mon Nov 16, 2015 12:02 pm
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

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

Posted: Mon Nov 16, 2015 1:09 pm
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