In this final Voice XML article installment the author takes a look at
how voice can add a new rich dimension to your Web applications,
especially those centered around XML. With Web 2.0 and mashups on the
rise, adding Voice XML to the mix lets you pull and push Web-based
information to your users wherever they may roam. JavaScript
(ECMAScript) has been getting a lot of attention lately in the Web 2.0
zone as the key ingredient for doing client-side AJAX. The good news
is that much of that JavaScript expertise can be leveraged in your
Voice XML applications. One of the benefits of ECMAScript is that you
can access Voice XML variables within ECMAScript. Elements that accept
the 'expr' attribute can use arbitrary ECMAScript code to generate a
value at runtime. And you can abstract your commonly used ECMAScript
functions into functions or libraries to support reuse in your Voice
XML pages. Some key things to note about JavaScript include the
following: (1) Voice XML variables are equivalent to ECMAScript
variables. Voice XML variables can be passed to JavaScript functions.
Values returned from functions can be stored in Voice XML variables.
(2) The expr attribute available with many tags can refer not only to
Voice XML or ECMAScript variables but also can include ECMAScript
function call expressions. (3) ECMAScript can be placed inline in the
Voice XML document using the 'script' element, or scripts can be
loaded from a URI. (4) ECMAScript functions follow the familiar scope
hierarchy... Dynamic Voice XML takes us to a higher level, enabling us
to create more robust and up-to-date applications by dynamically
creating Voice XML using server data. To do dynamic Voice XML we need
a server technology to trigger the conversion of data in a data
repository to Voice XML. Server technologies capable of handling this
include Java Servlets, Java Server Pages (JSPs), Active Server Pages
(ASPs), PHP scripts and many other server-side scripting technologies.
The basic idea is to use a program to extract data from a repository
and generate a valid Voice XML document. While this might sound complex,
involving setting up a relational database and writing code to extract
and generate XML, [but] in XML-land and have at our disposal a variety
of XML tools -- one of the most powerful being XSLT, the XML transform
language... The release of the Voice XML 2.0 standard has been
instrumental in giving developers a cross-platform way not only to
build stand-alone voice applications but also to integrate voice into
a broad range of web service-based applications. Harnessing the speech
recognition and text to speech technologies available from voice
providers, Voice XML enables developers to build powerful
voice-controlled apps by defining their own domain-specific grammars
by writing their own application-specific JavaScript and by submitting
data from Voice XML to server-side gateways that can establish
connections with any other server or web service available across the
Internet. More Information
No comments:
Post a Comment