Recommendation for xml:lang expressions

In a VXML script, I prompt the caller for language and get a result from a <field>.  I need a way to programmatically express to all additional <audio> tags in my application that the language selected by my caller (let's say 'es') is to be used for TTS.  The <s xml:lang='es'> works if I wanted to hand-code this stuff and have <if> blocks all over the place to see what language to play the audio in, but I'm too lazy to do this much work.  I would really like to have a new attribute in the <s>, <p> and <voice> tags that lets me pass an ecmascript expression that is evaluated and placed into the xml:lang property before sending it over to the SSML engine.

As it is right now, in order to read a dollar amount in either Spanish or English, depending on what the caller chose, I have to do this:

<if cond="callerXmlLang == 'es'">
       <prompt>
              <s xml:lang="es">
                     <value expr="'$' + thisAmount"/>
              </s>
       </prompt>
</if>
<if cond="callerXmlLang == 'en'">
       <prompt>
              <s xml:lang="en">
                     <value expr="'$' + thisAmount"/>
              </s>
       </prompt>
</if>

I also considered using javascript to change the xml:lang attribute on the <vxml> tag, but this would be painful to have to set within every <form> that is called via <subdialog>, since the application context is fresh everytime you use <subdialog>.

Attention: This message and all attachments are private and may contain
information that is confidential and privileged. If you received this
message in error, please notify the sender by reply email and delete
the message immediately.

Received on Friday, 23 May 2014 06:50:58 UTC