RE: Recommendation for xml:lang expressions

I agree that using the web server to dynamically write the content, of course, does work.  But I disagree pretty strongly that real world applications require dynamic generation of content (although some do choose to work that way, and a number of developer tools work that way, but in no way is it required).  But literally billions of static VXML pages are processed each and every day for complicated voice applications for fortune 500 companies.  And that’s just on the platform I’m most familiar with.

Some of the VXML 2.1 features were really to help make easier and more powerful the static and declarative client side programming model (in particular especially the <data> tag and <foreach>).

From: Ales Dolecek (Europe) [mailto:ales.dolecek@dimensiondata.com]
Sent: Wednesday, May 28, 2014 4:13 PM
To: David Wright; www-voice@w3.org
Subject: RE: Recommendation for xml:lang expressions

Hello,

  this can be elegantly solved on the web application server. Once you know the language you submit it to WAS and it shall render further VoiceXML documents with proper language in the <vxml> element. You can have multiple prompts in the document for different languages and only change the root vxml element. Taking your example the server shall output

For Spanish:
<vxml … xml:lang="es">
…
       <prompt xml:lang="es">
              <s><value expr="'$' + thisAmount"/></s>
       </prompt>
       <prompt xml:lang="en">
              <s><value expr="'$' + thisAmount"/></s>
       </prompt>
…
</vxml>

Or for English:
<vxml … xml:lang="en">
…
       <prompt xml:lang="es">
              <s><value expr="'$' + thisAmount"/></s>
       </prompt>
       <prompt xml:lang="en">
              <s><value expr="'$' + thisAmount"/></s>
       </prompt>
…
</vxml>

The interpreter will play only prompts that match language of the document.

Generally: Writing voice application with only static VoiceXML documents is usually not feasible. Maybe fixed menu. But the real-world applications in 99% require dynymic generation of VoiceXML – starting from template documents and filling just little pieces (like above) ending with servers that generate VoiceXML on-fly form dynamic models edited by GUIs.

Ales


Aleš Doleček
Senior Consultant
Dimension Data Czech Republic
Tel: +420 255 770 737
Mob: +420 737 269 737
Fax: +420 255 770 120
Email: ales.dolecek@dimensiondata.com<mailto:ales.dolecek@dimensiondata.com>

Na Hrebenech II 1718/10, Praha 4, Czech republic, 140 00, Czech Republic

Dimension Data is an NTT Group company. For further information about Dimension Data, please go to www.dimensiondata.com<http://www.dimensiondata.com>
Follow us on Social Media Blog<http://blog.dimensiondata.com> Facebook<http://www.facebook.com/pages/Dimension-Data-Europe/208242309194429> LinkedIn<http://www.linkedin.com/company/dimension-data> Twitter<http://twitter.com/DimensionData>

P Before printing this email please think about the environment

[cid:image001.png@01CF7C06.C3E693F0]<http://www.dimensiondata.com/global/solutions/ucc/index.html>

Default Banner
From: David Wright [mailto:David.Wright@OntarioSystems.com]
Sent: Wednesday, May 21, 2014 8:45 PM
To: www-voice@w3.org<mailto:www-voice@w3.org>
Subject: 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>.

Received on Friday, 30 May 2014 20:02:19 UTC