Voice Extensible Markup Language (VoiceXML) 2.

1

http://www.w3.org/TR/2005/CR-voicexml21-20050613/

Voice Extensible Markup Language (VoiceXML) 2.1
W3C Candidate Recommendation 13 June 2005
This version: http://www.w3.org/TR/2005/CR-voicexml21-20050613/ Latest version: http://www.w3.org/TR/voicexml21/ Previous version: http://www.w3.org/TR/2004/WD-voicexml21-20040728/ Editors: Matt Oshry, Tellme Networks (Editor-in-Chief) RJ Auburn, Voxeo Corporation Paolo Baggia, Loquendo Michael Bodell, Tellme Networks David Burke, Voxpilot Ltd. Daniel C. Burnett, Invited Expert Emily Candell, Comverse Hakan Kilic, Scansoft Scott McGlashan, Hewlett-Packard Alex Lee, VoiceGenie Brad Porter, Tellme Networks Ken Rehor, Vocalocity A non-normative version of this document showing changes made since the previous draft is also available.
Copyright © 2005W3C (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
®

Abstract
VoiceXML 2.1 specifies a set of features commonly implemented by Voice Extensible Markup Language platforms. This specification is designed to be fully backwards-compatible with VoiceXML 2.0 [VXML2]. This specification describes only the set of additional features.

Status of this Document
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

1 of 32

11/15/2010 2:50 PM

Voice Extensible Markup Language (VoiceXML) 2.1

http://www.w3.org/TR/2005/CR-voicexml21-20050613/

This is the 13 June 2005 W3C Candidate Recommendation of "VoiceXML Version 2.1". W3C publishes a technical report as a Candidate Recommendation to indicate that the document is believed to be stable and to encourage implementation by the developer community. Candidate Recommendation status is described in section 7.1.1 of the Process Document. Comments can be sent until 11 July 2005. Publication as a Candidate Recommendation does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress. This document has been produced as part of the Voice Browser Activity (activity statement), following the procedures set out for the W3C Process. The authors of this document are members of the Voice Browser Working Group (W3C Members only). This document was produced under the 5 February 2004 W3C Patent Policy. The Working Group maintains a public list of patent disclosures relevant to this document; that page also includes instructions for disclosing [and excluding] a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) with respect to this specification should disclose the information in accordance with section 6 of the W3C Patent Policy. This document is for public review, and comments and discussion are welcomed on the (archived) public mailing list <www-voice@w3.org>. This document is based upon the VoiceXML Version 2.1 Last Call Working Draft of 28 July 2004 and feedback received during the review period (see the Disposition of Comments document). The Voice Browser Working Group (member-only link) believes that this specification addresses its requirements and all Last Call issues. The entrance criteria to the Proposed Recommendation phase require at least two independently developed interoperable implementations of each required feature, and at least one or two implementations of each optional feature depending on whether the feature's conformance requirements have an impact on interoperability. Detailed implementation requirements and the invitation for participation in the Implementation Report are provided in the Implementation Report Plan. Note, this specification already has significant implementation experience that will soon be reflected in its Implementation Report. We expect to meet all requirements of that report within the Candidate Recommendation period closing 11 July 2005. In this document, the key words "must", "must not", "required", "shall", "shall not", "should", "should not", "recommended", "may", and "optional" are to be interpreted as described in [RFC2119] and indicate requirement levels for compliant VoiceXML implementations. The sections in the main body of this document are normative unless otherwise specified. The appendices in this document are informative unless otherwise indicated explicitly.

Table of Contents
1 Introduction 1.1 Elements Introduced or Enhanced in VoiceXML 2.1 2 Referencing Grammars Dynamically 3 Referencing Scripts Dynamically 4 Using <mark> to Detect Barge-in During Prompt Playback 5 Using <data> to Fetch XML Without Requiring a Dialog Transition

2 of 32

11/15/2010 2:50 PM

Voice Extensible Markup Language (VoiceXML) 2.1

http://www.w3.org/TR/2005/CR-voicexml21-20050613/

5.1 <data> Fetching Properties 6 Concatenating Prompts Dynamically Using <foreach> 7 Recording User Utterances While Attempting Recognition 7.1 Specifying the Media Format of Utterance Recordings 8 Adding namelist to <disconnect> 9 Adding type to <transfer> 9.1 Consultation Transfer 9.2 Consultation Transfer Errors and Events 9.3 Example of a Consultation Transfer

Appendices
A VoiceXML Document Type Definition B VoiceXML Schema C Conformance C.1 Conforming VoiceXML 2.1 Document C.2 Using VoiceXML with other namespaces C.3 Conforming VoiceXML 2.1 Processors D ECMAScript Language Binding for DOM E References E.1 Normative References E.2 Other References E.3 Acknowledgements F Summary of changes since the Last Call Working Draft

1 Introduction
The popularity of VoiceXML 2.0 [VXML2] spurred the development of numerous voice browser implementations early in the specification process. [VXML2] has been phenomenally successful in enabling the rapid deployment of voice applications that handle millions of phone calls every day. This success has led to the development of additional, innovative features that help developers build even more powerful voice-activated services. While it was too late to incorporate these additional features into [VXML2], the purpose of VoiceXML 2.1 is to formally specify the most common features to ensure their portability between platforms and at the same time maintain complete backwards-compatibility with [VXML2]. This document defines a set of 8 commonly implemented additional features to VoiceXML 2.0 [VXML2].

1.1 Elements Introduced or Enhanced in VoiceXML 2.1
The following table lists the elements that have been introduced or enhanced in VoiceXML 2.1. Element <data> Purpose Fetches arbitrary XML data from a document server. Section New/Enhanced 5 New

<disconnect> Disconnects a session. 8 Enhanced Table 1: Elements Introduced or Enhanced in VoiceXML 2.1

3 of 32

11/15/2010 2:50 PM

</prompt> </field> <field name="street"> <grammar type="application/srgs+xml" srcexpr="country + '/' + city + '/streets <prompt> What street in <value expr="city"/> are you looking for? </prompt> </field> <filled> <prompt> You chose <value expr="street"/> in <value expr="city"/> 4 of 32 11/15/2010 2:50 PM . Iterates through an ECMAScript array.grxml"/> <prompt>Say a country. 7 3 9 Enhanced New Enhanced Enhanced Enhanced Enhanced 2 Referencing Grammars Dynamically As described in section 3. The following example demonstrates capturing a street address. and the third field requests a street.w3. an error. "srcexpr".</prompt> </field> <field name="city"> <grammar type="application/srgs+xml" srcexpr="country + '/cities. Controls platform settings. References a document containing client-side ECMAScript.org/TR/2005/CR-voicexml21-20050613/ <grammar> <foreach> <mark> <property> <script> <transfer> References a speech recognition or DTMF grammar. Table 1: <grammar> Attributes Exactly one of "src". the <grammar> element allows the specification of a speech recognition or DTMF grammar. Transfers the user to another destination.1 extends the <grammar> element to support the following additional attribute: Equivalent to src.grxml"/> <prompt>What city in <value expr="country"/>.semantic event is thrown.1 of [VXML2]. VoiceXML 2. Declares a bookmark in a sequence of prompts.1.Voice Extensible Markup Language (VoiceXML) 2.g. an error. The grammar for the third field is selected dynamically using the result of the city field. <?xml version="1.badfetch event is thrown. If srcexpr cannot be evaluated. 2 6 4 5. The srcexpr expression must be evaluated each time the grammar needs to be activated. otherwise. The first field requests a country. the second field requests a city.org/2001/vxml" version="2. The grammar for the second field is selected dynamically using the result of the country field. the current form item).1 http://www.0" encoding="UTF-8"?> <vxml xmlns="http://www. or an inline grammar must be specified.1"> <form id="get_address"> <field name="country"> <grammar type="application/srgs+xml" src="country. except that the URI is dynamically determined by evaluating the given ECMAScript expression in the current scope (e.w3.

semantic event is thrown. The following example retrieves a script from a URI that is composed at run-time using the variable scripts_baseuri. 5 of 32 11/15/2010 2:50 PM . an error. "srcexpr". name.org/'"/> <form> <script srcexpr="scripts_baseuri + 'lib/util.1 extends the <script> element to support the following additional attribute: Equivalent to src. Table 2: <script> Attributes Exactly one of "src".3. an error. The expression must be evaluated each time the srcexpr script needs to be executed.example. [SSML] defines a single attribute.3.1"> <var name="scripts_baseuri" expr="'http://www.badfetch event is thrown.js'"/> </form> </vxml> 4 Using <mark> to Detect Barge-in During Prompt Playback As described in section 3. the <mark> element places a marker into the text/tag sequence. VoiceXML 2. an error. VoiceXML 2.w3.Voice Extensible Markup Language (VoiceXML) 2.2 of [SSML].12 of [VXML2]. otherwise.1 http://www.0" encoding="UTF-8"?> <vxml xmlns="http://www. An SSML processor must either allow the VoiceXML interpreter to retrieve or must inform the interpreter when a <mark> is executed during audio output.org/2001/vxml" version="2. <?xml version="1. or an inline script must be specified. If nameexpr cannot be evaluated.org/TR/2005/CR-voicexml21-20050613/ <value expr="country"/> </prompt> <exit/> </filled> </form> </vxml> 3 Referencing Scripts Dynamically As described in section 5. on the <mark> element. allowing the programmer to name the mark. Table 3: <mark> Attributes Exactly one of "name" and "nameexpr" must be specified. the <script> element allows the specification of a block of client-side scripting language code. except that the URI is dynamically determined by evaluating the given ECMAScript expression.semantic event is thrown.1 extends the <mark> element to support the following additional attribute: nameexpr An ECMAScript expression which evaluates to the name of the mark. If srcexpr cannot be evaluated.badfetch event is thrown. otherwise.w3. an error. and is analogous to the [HTML4] <SCRIPT> element.

the <mark> element is permitted in conforming VoiceXML documents.1. a <link> is matched) and a <mark> has been executed.g.markname=='ad_start' &amp. If no mark was executed. (team$.0" encoding="UTF-8"?> <vxml xmlns="http://www. Elephant Peanuts.grxml"/> <filled> <if cond="typeof(team$.3 of [VXML2]) has also been filled and has its shadow variables assigned. this variable is undefined. When a <mark> is executed during the flushing of the prompt queue as a result of encountering a fetchaudio.org/2001/vxml" version="2. The following example establishes marks at the beginning and at the end of an advertisement.org/TR/2005/CR-voicexml21-20050613/ As described in section 4.lastresult$ object. this variable is undefined. <mark name="ad_end"/> <break time="500ms"/> Say the name of a team. Processors of conforming VoiceXML 2. the interpreter must also assign markname and marktime shadow variables.lastresult$ object whenever the application.lastresult$ object. Table 4: <mark>-related application. say Boston Red Sox. was last executed when bargein occurred. if an input item (as defined in section 2. The number of milliseconds that elapsed since the last mark was executed by marktime the SSML processor until barge-in occurred or the end of audio playback occurred.lastresult$ object should not be modified and no shadow variables should be assigned.w3. the code checks which mark. </prompt> <grammar type="application/srgs+xml" src="teams. For example. team$.markname=='ad_end' || (team$.1 documents must set the following two properties on the application. In the <filled>. if any.lastresult$ properties When these properties are set on the application.&amp.1"> <var name="played_ad" expr="false"/> <form> <field name="team"> <prompt> <mark name="ad_start"/> Baseball scores brought to you by Elephant Peanuts. The name of the mark last executed by the SSML processor before barge-in markname occurred or the end of audio playback occurred. the application. There's nothing like the taste of fresh roasted peanuts.Voice Extensible Markup Language (VoiceXML) 2.&amp. Ask for them by name.= 5000))"> <assign name="played_ad" expr="true"/> <else/> <assign name="played_ad" expr="false"/> </if> 6 of 32 11/15/2010 2:50 PM . the code checks that at least 5 seconds of the advertisement has been played and sets the played_ad variable appropriately. the values of which equal the corresponding properties of the application.1 http://www.lastresult$ object is assigned (e. If no mark was executed. but [VXML2] does not specify a standard way for VoiceXML processors to access <mark> element information.w3. <?xml version="1.markname) == 'string' &amp.marktime &gt.1 of [VXML2]. If the "ad_start" mark is executed but "ad_end" is not.

semantic event is thrown. If srcexpr cannot be evaluated. This defaults to the fetchtimeout property described in Section 6. otherwise. See Section 6. This defaults to the datamaxage property described in Section 5. Interpreters must also support multipart/form-data and may support additional encoding types. Table 5: <data> Attributes namelist enctype fetchaudio fetchhint fetchtimeout maxage maxstale Exactly one of "src" or "srcexpr" must be specified.5 of [VXML2]. Declared VoiceXML and ECMAScript variables can be referenced. the name attribute must not be set.1 of [VXML2].w3.3.1.6 of [VXML2]. it may contain individual variable references which are submitted with the same qualification used in the namelist.Voice Extensible Markup Language (VoiceXML) 2. an error. the interpreter throws an error as specified for fetch failures in Section 5. The XML data fetched by the <data> element is bound to ECMAScript through the named variable that exposes a read-only subset of the W3C Document Object Model (DOM). See Section 6. no variables are submitted. If the name attribute is present.org/TR/2005/CR-voicexml21-20050613/ </filled> </field> </form> </vxml> 5 Using <data> to Fetch XML Without Requiring a Dialog Transition The <data> element allows a VoiceXML application to fetch arbitrary XML data from a document server without transitioning to a new VoiceXML document. The media encoding type of the submitted document. and any retrieved content must be ignored by the interpreter. The default is application/x-www-form-urlencoded. If an implementation does not support DOM.3. This defaults to the datamaxstale property described in Section 5. The list of variables to submit. The name of the variable that exposes the DOM.2. If the content cannot be retrieved.1 http://www. This defaults to the fetchaudio property described in Section 6. The request method: get (the default) or post. an error.1 of [VXML2]. Platforms should support parsing XML data into a DOM. This defaults to the datafetchhint property described in Section 5.1.badfetch event is thrown. except that the URI is dynamically determined by evaluating the given ECMAScript expression when the data needs to be fetched. Attributes of <data> are: src name srcexpr method The URI specifying the location of the XML data to retrieve. If a namelist is supplied. See Section 6. See Section 6.1 of [VXML2].1.5 of [VXML2].1 of [VXML2]. these implementations will throw 7 of 32 11/15/2010 2:50 PM . By default. Like src.1 of [VXML2]. See Section 6.

semantic. Like the <submit> element. the variable is assigned a reference to the DOM exposed by the <data> element. In the examples that follow. In addition. If use of the DOM causes a DOMException to be thrown. If a <data> element's namelist contains a variable which references recorded audio but does not contain an enctype of multipart/form-data. but the DOMException is not caught by an ECMAScript catch handler.1 http://www. it shares the same scoping rules as the <var> element. If the variable is an ECMAScript Object the mechanism by which it is submitted is not currently defined. An interpreter may support additional data formats by recognizing additional media types.org/TR/2005/CR-voicexml21-20050613/ error. If access is denied the interpreter must throw error.name.xml"/> <script><![CDATA[ var price = quote. Like the <var> element. the interpreter throws error. and the returned document is XML.documentElement.item(0). Note: One strategy commonly implemented in voice browsers to control access to data is the "access-control" processing instruction described in the WG Note: Authorizing Read Access to XML Content Using the <?access-control?> Processing Instruction 1. the VoiceXML interpreter must expose the retrieved content via a read-only subset of the DOM as specified in Appendix D.00</last> </quote> The following example assigns the value of the "last" element to the ECMAScript variable "price": <data name="quote" src="quote.00</change> <last>30. the interpreter should check that the referring document is allowed to access the data. If the name attribute is present. or the data is not well-formed as defined by the specification of that format.unsupported.badfetch.badfetch. when an ECMAScript variable is submitted to the server its value is first converted into a string before being submitted.0" encoding="UTF-8"?> <quote> <ticker>F</ticker> <name>Ford Motor Company</name> <change>1. the interpreter throws error. the XML document fetched by the <data> element is in the following format: <?xml version="1. the VoiceXML interpreter throws error.firstChild. If the media type of the retrieved content is "text/xml" but the content is not well-formed XML.0 8 of 32 11/15/2010 2:50 PM . ]]></script> The data is fetched when the <data> element is executed according to the caching rules established in Section 6.data. It is probably inappropriate to attempt to URL-encode large quantities of data. the <data> element can occur in executable content or as a child of <form> or <vxml>. If an interpreter receives a document in a data format that it does not understand. Before exposing the data in an XML document referenced by the <data> element via the DOM.Voice Extensible Markup Language (VoiceXML) 2.w3.1 of [VXML2].noauthorization. the behavior is not specified. If a <data> element has the same name as a variable already declared in the same scope.getElementsByTagName("last").

1 http://www.org/TR/2005/CR-voicexml21-20050613/ [DATA_AUTH].w3. The following example retrieves a stock quote in one dialog. and uses the DOM to playback the quote in another dialog. 9 of 32 11/15/2010 2:50 PM .Voice Extensible Markup Language (VoiceXML) 2. caches the DOM in a variable at document scope.

0)"/> name="last_parts" expr="last. 'unknown') <!-.0" encoding="UTF-8"?> <vxml xmlns="http://www. so return this instead return nodata. or negative c <if cond="change == 0"> <audio src="unchanged_at. positive.documentElement"/> <goto next="#play_quote"/> </block> </form> <form id="play_quote"> <script><![CDATA[ // retrieve the value contained in the node t from the DOM exposed by d function GetData(d.getElementsByTagName(t).wav'"><value expr="last_parts[0]"/></audio> <if cond="Number(last_parts[1]) &gt.play 'unchanged. nodata) { try { return d.wav'"><value expr="GetData(quote.org/getquote?ticker=' + tick <assign name="document.quote" expr="quote.play change in value as positive number --> <audio expr="Math. 'up'.item(0). 0"> <audio src="up.abs(change) + '.wav"/> <!-.wav"/> <else/> <if cond="change &gt.w3. 'last'. 'change'.')"/> <!--play the company name --> <audio expr="ticker + '.wav"/> <else/> <!-. 0"> <audio src="point.firstChild.wav"/> <audio expr="last_parts[1] + '.Voice Extensible Markup Language (VoiceXML) 2.split('.1 http://www. 0)"/> name="last" expr="GetData(quote.org/2001/vxml" version="2.1"> <var name="quote"/> <var name="ticker" expr="'f'"/> <form id="get_quote"> <block> <data name="quote" srcexpr="'http://www.example.data.org/TR/2005/CR-voicexml21-20050613/ <?xml version="1.abs(change)"/>< <audio src="to. } } ]]></script> <block> <!-<var <var <var retrieve the change in the stock's value --> name="change" expr="GetData(quote.wav"/> </if> <audio src="by.play the current price per share --> <audio expr="last_parts[0] + '.w3.wav"/> </if> <!-. t.wav'"><value expr="last_parts[1]"/></audio </if> </block> </form> </vxml> 5. or 'down' based on zero.1 <data> Fetching Properties These properties pertain to documents fetched by the <data> element. 10 of 32 11/15/2010 2:50 PM .wav'"><value expr="Math. } catch(e) { // the value could not be retrieved. 'name'.negative --> <audio src="down.

just 11 of 32 11/15/2010 2:50 PM .semantic event is thrown. if a noinput or a nomatch event occurs. the VoiceXML interpreter reprompts the user by executing the second <prompt>. The following example calls a user-defined function GetMovieList that returns an ECMAScript array.org/TR/2005/CR-voicexml21-20050613/ datafetchhint datamaxage datamaxstale Tells the platform whether or not data documents may be pre-fetched.1"> <script src="movies. A new variable will be declared if it is not already defined within the parent's scope.Voice Extensible Markup Language (VoiceXML) 2.w3.</prompt> <prompt count="2"> <audio src="prelist. Attributes of <foreach> are: array item An ECMAScript expression that must evaluate to an array. Tells the platform the maximum acceptable age. <?xml version="1. otherwise. Upon entering the <field>. The default is platform-specific. or safe.grxml"/> <prompt>Say the name of the movie you want. The array is assigned to the variable named 'prompts'. otherwise.1 http://www.0" encoding="UTF-8"?> <vxml xmlns="http://www.wav">When you hear the name of the movie you want.js"/> <form id="pick_movie"> <!-GetMovieList returns an array of objects with properties audio and tts. The <foreach> element can occur in executable content and as a child of <prompt>. in seconds. Table 6: <data> Fetching Properties 6 Concatenating Prompts Dynamically Using <foreach> The <foreach> element allows a VoiceXML application to iterate through an ECMAScript array and to execute the content contained within the <foreach> element for each item in the array. of expired cached data documents. an error.org/2001/vxml" version="2. --> <var name="prompts" expr="GetMovieList()"/> <field name="movie"> <grammar type="application/srgs+xml" src="movie_names. Table 7: <foreach> Attributes Both "array" and "item" must be specified. Upon each iteration of the <foreach>. an error.badfetch event is thrown. of cached documents. the interpreter executes the contained <audio> and <break> elements. The default is platform-specific. The size of the array is undetermined until runtime. in seconds. The value is either prefetch (the default). The variable that stores each array item upon each iteration of the loop. Tells the platform the maximum acceptable staleness.w3. The second <prompt> executes the <foreach> element by iterating through the ECMAScript array 'prompts' and assigning each array element to the variable 'thePrompt'.

tts = "the godfather". the interpreter stores the current item in the array to the variable movie. I didn't get that.wav">raiders of the lost ark</audio> time="300ms"/> The following example combines the use of the <mark> and <foreach> elements to more precisely identify which item in a list of movies the user has selected. movies[1] = new Object().tts"/></audio> <break time="300ms"/> </foreach> </prompt> <noinput> I'm sorry.Voice Extensible Markup Language (VoiceXML) 2. if the form item variable mov is set to the value "more". movies[0].wav">the godfather</audio> time="300ms"/> src="high_fidelity. During each iteration of the <foreach>.wav". return movies. movies[2].w3. movies[2].org/2001/vxml" version="2.audio = "godfather. movies[2] = new Object().org/TR/2005/CR-voicexml21-20050613/ <foreach item="thePrompt" array="prompts"> <audio expr="thePrompt.tts = "raiders of the lost ark".0" encoding="UTF-8"?> <vxml xmlns="http://www. Upon execution of the <mark> element.audio = "high_fidelity.1"> 12 of 32 11/15/2010 2:50 PM . <reprompt/> </noinput> <nomatch> I'm sorry. movies[0]. movies[1].w3. <?xml version="1.wav">high fidelity</audio> time="300ms"/> src="raiders.tts = "high fidelity".markname. indicating the user's desire to hear more detail about the movie name that was played when the user barged in. movies[1]. If barge-in occurred within twenty milliseconds of the mark's execution. In the <filled>.wav".wav". } When the interpreter queues the second <prompt>. movies[0] = new Object(). <reprompt/> </nomatch> </field> </form> </vxml> The following is a contrived implementation of the user-defined GetMovieList function: function GetMovieList() { var movies = new Array(3). it expands the <foreach> element in the previous example to the following: <audio <break <audio <break <audio <break src="godfather.audio"><value expr="thePrompt. the name of the <mark> is set to the current value of the variable movie_idx which is incremented during each iteration of the loop using the <assign> element. I didn't hear you.1 http://www. the code retrieves the index of the preceding movie under the assumption that the user was slow to react. the code retrieves the index of the desired movie in the movies array from mov$.audio = "raiders.

user said a specific movie --> <assign name="movie_id" expr="mov"/> </if> </filled> </field> <!-Given a movie id. 13 of 32 11/15/2010 2:50 PM .js"/> <form id="list_movies"> <!-.= 1 ? 0 : mov$. <reprompt/> </catch> <catch event="noinput"> <reprompt/> </catch> <filled> <if cond="'more' == mov"> <!-.grxml"/> <grammar type="application/srgs+xml" src="movies. <break time="500ms"/> <foreach item="movie" array="movies"> <mark nameexpr="movie_idx"/> <audio expr="movie.user wants more detail --> <!-.alas. so adjust movie_idx --> <if cond="mov$.1 http://www.markname"/> </if> </if> <assign name="movie_id" expr="movies[movie_idx].markname &lt.markname != undefined"> <!-.id"/> <else/> <!-.grxml"/> <catch event="nomatch"> Sorry.marktime &lt.fetch the current list of movies. </prompt> <prompt count="2"> Here's the list of movies.GetMovieDetail returns an array of objects with properties audio and tts. a mark was executed. fetch detail.returns the id of the previous movie (or the first) --> <assign name="movie_idx" expr="(mov$. and play it back.w3.= 20"> <!-.markname-1)"/> <else/> <assign name="movie_idx" expr="mov$. I didn't get that. and transform them into an array --> <data name="domMovies" src="getmovies.assume no mark was executed --> <assign name="movie_idx" expr="0"/> <if cond="mov$. --> <block name="play_detail"> <!-. detail could be in a single wav file or in multiple files. say 'tell me more'.tts"/></audio> <break time="500ms"/> <assign name="movie_idx" expr="movie_idx+1"/> </foreach> </prompt> <grammar type="application/srgs+xml" src="more.cgi"/> <var name="movies" expr="GetMovieList(domMovies)"/> <var name="movie_idx" expr="0"/> <var name="movie_id"/> <field name="mov"> <prompt> Say the name of the movie.audio"><value expr="movie. To hear more about a movie.Voice Extensible Markup Language (VoiceXML) 2.org/TR/2005/CR-voicexml21-20050613/ <script src="movies.

wav</wav> <tts>francis ford coppola</tts> </detail> <detail> <wav>ratings/rated.wav</wav> </title> <details> <detail> <wav>directors/directed_by.tts"/></audio> </foreach> </block> </form> </vxml> The following is a contrived XML document returned by getmovies.wav</wav> </title> <details> <!-.w3.wav</wav> </title> <details> <!-.wav</wav> <tts/> </detail> <detail> <wav>synopsis/m0010. movie_id)"/> <foreach item="chunk" array="details"> <audio expr="chunk.cgi.audio"><value expr="chunk.Voice Extensible Markup Language (VoiceXML) 2. <?xml version="1.details omitted for the sake of brevity --> </details> </movie> 14 of 32 11/15/2010 2:50 PM .details omitted for the sake of brevity --> </details> </movie> <movie id="m0027"> <title> <tts>raiders of the lost ark</tts> <wav>raiders.1 http://www.wav</wav> <tts>r</tts></detail> <detail> <wav>pauses/300.org/TR/2005/CR-voicexml21-20050613/ <var name="details" expr="GetMovieDetail(domMovies. The user-defined GetMovieList and GetMovieDetail functions below are implemented to manipulate the DOM representation of its structure.wav</wav> <tts>a coming of age story about a nice italian boy</tts> </detail> </details> </movie> <movie id="m0052"> <title> <tts>high fidelity</tts> <wav>high_fidelity.wav</wav> <tts>directed by</tts> </detail> <detail> <wav>directors/coppola.wav</wav> <tts>rated</tts> </detail> <detail> <wav>ratings/r.0" encoding="UTF-8"?> <movies> <movie id="m0010"> <title> <tts>the godfather</tts> <wav>godfather.

try { var nodeRoot = domMovies.tts = "sorry.audio = GetWav(nodeTitle). i < nodeRoot.length. objError.org/TR/2005/CR-voicexml21-20050613/ </movies> The following is an implementation of the user-defined GetMovieList function: // return an array of user-defined movie objects retrieved from the DOM function GetMovieList(domMovies) { var movies = new Array(). } else { var objMovie = new Object().wav".childNodes. } function GetTTS(node) { return GetInnerText(GetChild(node. "title"). var nodeTitle = GetTitle(nodeChild). i < parent.nodeName) { continue. } // Given a node.item(i). } return movies.documentElement.childNodes. break. movies.childNodes. objMovie.tts = GetTTS(nodeTitle).getAttribute("id"). objMovie.w3. name) { var target = null. } } } catch(e) { // unable to build movie list var objError = new Object(). "wav")). objError. no movies are available." details. if (child. i++) { var nodeChild = nodeRoot.item(i). for (var i = 0.push(objMovie).id = nodeChild. "tts")).audio = "nomovies. if (null == node) { return s.push(objError). if ("movie" != nodeChild. } // perform a shallow traversal of the node referenced by parent // looking for the named node function GetChild(parent.childNodes. } 15 of 32 11/15/2010 2:50 PM . i++) { var child = parent. for (var i = 0. objMovie.Voice Extensible Markup Language (VoiceXML) 2. } } return target. } function GetTitle(nodeMovie) { return GetChild(nodeMovie.1 http://www. dig the text nodes out and return them as a string function GetInnerText(node) { var s = "".length.nodeName == name) { target = child. } function GetWav(node) { return GetInnerText(GetChild(node.

push(objError). for (var i = 0." details. objDetail. id) { var details = new Array(). objTitle.length. if (Node. var nodeTitle = GetTitle(nodeMovie).wav">high fidelity</audio> <break time="300ms"/> <mark name="2"/> <audio src="raiders.nodeType || Node. details for that movie are unavailable.length.childNodes.getElementById(id). it expands the <foreach> element to the following: 16 of 32 11/15/2010 2:50 PM . objDetail. var objTitle = new Object().childNodes.audio = GetWav(nodeChild).childNodes.wav". } } } catch(e) { // couldn't get movie details var objError = new Object(). try { var nodeMovie = domMovies. } The following is an implementation of the user-defined GetMovieDetail function: // get the details about the movie specified by id function GetMovieDetail(domMovies. } else if (Node.push(objDetail). objError.childNodes. objTitle. objError.nodeTyp s += child.data.w3. if ("detail" == nodeChild.nodeType) { s += GetInnerText(child).item(i).item(i).tts = GetTTS(nodeTitle). when the interpreter executes the "play_detail" <block>.Voice Extensible Markup Language (VoiceXML) 2. i < nodeDetails.wav">raiders of the lost ark</audio> <break time="300ms"/> If the user chooses "The Godfather".push(objTitle).CDATA_SECTION_NODE == child.tts = GetTTS(nodeChild).nodeName) { var objDetail = new Object(). i < node.audio = "nomovie.ELEMENT_NODE == child. it expands the <foreach> element to the following: <mark name="0"/> <audio src="godfather.audio = GetWav(nodeTitle). } When the interpreter queues the second <prompt> in the field named "mov".wav">the godfather</audio> <break time="300ms"/> <mark name="1"/> <audio src="high_fidelity.tts = "sorry. var nodeDetails = GetChild(nodeMovie. details. } return details. "details").TEXT_NODE == child.org/TR/2005/CR-voicexml21-20050613/ for (var i = 0. i++) { var nodeChild = nodeDetails.1 http://www. } } return s. i++) { var child = node. details.

wav">francis ford coppola</audio> src="ratings/rated.3.wav">a coming of age story about a nice italian boy</audi 7 Recording User Utterances While Attempting Recognition Several elements defined in [VXML2] can instruct the interpreter to accept user input during execution. The duration of the recording in milliseconds. On the third recording recordingsize recordingduration 17 of 32 11/15/2010 2:50 PM .g. <data>. and the method attribute must be set to "post". Support for this feature is optional on <record>.Voice Extensible Markup Language (VoiceXML) 2.w3. or undefined if no audio is collected. recordingsize.lastresult$ properties. the implementation of this variable may vary between platforms. The size of the recording in bytes.lastresult$ object. If the recordutterance property is set to true in the current scope.lastresult$ object.wav">r</audio> src="pauses/300. set the value of the recordutterance property to true. since no input item has its shadow variables set. in the case of <link> and <menu>. the values of which equal the corresponding properties of the application.lastresult$ object is assigned (e. Like recordings created using the <record> tag.1 extends these elements to allow the interpreter to conditionally enable recording while simultaneously gathering input from the user. <menu>. Like the input item variable associated with a <record> element as described in section 2.org/TR/2005/CR-voicexml21-20050613/ <audio <audio <audio <audio <audio <audio src="directors/directed_by. the interpreter must allow the utterance recording to be assigned to and posted via any valid ECMAScript variable.3 of [VXML2]) has also been filled and has its shadow variables assigned. Platforms that support it set the aforementioned shadow variables on the associated form item variable and the corresponding properties on the application. <link>. utterance recordings can be played back using the expr attribute on <audio>. The enctype attribute must be set to "multipart/form-data". and recordingduration shadow variables for these input items. the dialog requests a city and state from the user. if an input item (as defined in section 2. To provide flexibility in the naming of the variable that is submitted to the document server. or undefined if no audio is collected. <initial>.wav">rated</audio> src="ratings/r. For example. These elements include <field>. <record>. VoiceXML 2. or undefined if no audio is collected.1 http://www.lastresult$ object when the recordutterance property is set to true in an encompassing scope. and <transfer>. the following three shadow variables are set on the application. In the following example. the interpreter only sets the application.wav">directed by</audio> src="directors/coppola. and <subdialog> elements. utterance recordings can be submitted to a document server via HTTP POST using the namelist attribute of the <submit>. To enable recording during recognition. and <transfer>.wav"/> src="synopsis/m0010. Like recordings created using the <record> tag. when a <link> is matched): The variable that stores a reference to the recording.lastresult$ object whenever the application. Table 8: recordutterance-related shadow variables When these properties are set on the application. the interpreter must also assign recording.6 of [VXML2].

both sets of variables are available to the interpreter context.w3. the platform throws an error. Table 9: <disconnect> Attributes The <disconnect> namelist and the <exit> namelist are processed independently. VoiceXML 2. If an undeclared variable is referenced in the namelist.lastresult$. <reprompt/> </nomatch> <nomatch count="3"> <var name="the_recording" expr="application.w3. the <disconnect> element causes the interpreter context to disconnect from the user. The recordutterancetype property defaults to a platformspecific format which should be one of the required formats. If the interpreter executes both a <disconnect> namelist and an <exit> namelist. The precise mechanism by which these 18 of 32 11/15/2010 2:50 PM .format event which specifies the unsupported media format in its message variable. Other formats may also be supported.1 of [VXML2]). 8 Adding namelist to <disconnect> As described in section 5. then an error. I didn't get that.recording"/> <submit method="post" enctype="multipart/form-data" next="upload.org/2001/vxml" version="2.1 extends the <disconnect> element to support the following attribute: Variable names to be returned to the interpreter context.1 Specifying the Media Format of Utterance Recordings To specify the media format of the resulting recording.1 http://www.1. </prompt> <grammar type="application/srgs+xml" src="citystate.0" encoding="UTF-8"?> <vxml xmlns="http://www.org/TR/2005/CR-voicexml21-20050613/ recognition failure.Voice Extensible Markup Language (VoiceXML) 2.1"> <form> <property name="recordutterance" value="true"/> <field name="city_state"> <prompt> Say a city and state. the recording of the user's utterance is submitted to a document server.semantic is thrown (5. this means the interpreter context will receive an empty ECMAScript namelist object. set the recordutterancetype property.cgi" namelist="the_recording"/> </nomatch> </field> </form> </vxml> 7.11 of [VXML2]. Platforms must support the audio file formats specified in Appendix E of [VXML2]. <?xml version="1.grxml"/> <nomatch> I'm sorry. If an unsupported media format is encountered during recognition. The default is to return no variables.unsupported. Note that the recordutterancetype property does not affect the <record> element.3.

no answer. The behavior of the bridge attribute is fully specified in section 2. the interpreter's behavior must be identical to its behavior when the bridge attribute is set to "false". The maxtime attribute of <transfer> applies if the type attribute is set to "bridge". connection. or "consultation". the <transfer> element directs the interpreter to connect the caller to another entity. and [ETSI300_369]. developers are encouraged to use the type attribute on platforms that implement it. Any connection between the caller and the callee remains in place regardless of document execution. the value of the type attribute takes precedence over the default value of the bridge attribute. though platforms should support it.1 extends the <transfer> element to support the following additional attribute: type The type of transfer.Voice Extensible Markup Language (VoiceXML) 2. When performing a consultation transfer.7 of [VXML2]. The bridge attribute is maintained for backwards compatiblity with [VXML2].3.3. the platform monitors the progress of the transfer until the connection is established between caller and callee. 9 Adding type to <transfer> As described in section 2. or consultation transfer types.). and document interpretation continues normally. VoiceXML 2. blind. the session remains active and returns control to the application.transfer is thrown. For additional information on call transfers with consultation-like functionality see [ATT_50075]. "blind". Table 10: <transfer> Attributes Exactly one of "bridge" or "type" may be specified.1 Consultation Transfer The consultation transfer is similar to a blind transfer except that the outcome of the transfer call setup is known and the caller is not dropped as a result of an unsuccessful transfer attempt. if the connection is established. line busy. If the value of the type attribute is set to "bridge".w3. If the connection cannot be established (e. etc.7 of [VXML2]. 19 of 32 11/15/2010 2:50 PM . [MCI_ECR]. otherwise an error.1 http://www. Platforms that support <transfer> may support any combination of bridge. the <transfer> element is optional. The connecttimeout attribute of <transfer> applies if the type attribute is set to "bridge" or "consultation".badfetch event is thrown. As in the case of a blind transfer. 9. Since all of the functionality of the bridge attribute has been incorporated into the type attribute.g. If the type attribute is specified and the bridge attribute is absent. If the value of the type attribute is set to "blind".disconnect. the interpreter disconnects from the session. the interpreter's behavior must be identical to its behavior when the value of the bridge attribute is set to "true".7 of [VXML2]. As specified in 2.org/TR/2005/CR-voicexml21-20050613/ variables are made available to the interpreter context is platform specific. The value can be "bridge".3.

Table 11: Consultation Transfer Outcomes Prior to Connection Being Established unknown 20 of 32 11/15/2010 2:50 PM . The caller cancelled the transfer attempt via a DTMF or voice command before the outgoing call begins (during playback of queued audio). network busy network_busy callee does not answer noanswer --- The transfer ended but the reason is not known.disconnect. There was no answer within the time specified by the connecttimeout attribute.Voice Extensible Markup Language (VoiceXML) 2.hangup The caller hung up. The callee was busy.w3.org/TR/2005/CR-voicexml21-20050613/ Figure 1: Audio Connections during a consultation transfer: <transfer type="consultation"/> The possible outcomes for a consultation transfer before the connection to the callee is established are: Action caller disconnects caller cancels transfer near_end_disconnect before outgoing call begins callee busy busy Value of form item variable Event Reason connection. An intermediate network refused the call.1 http://www.

The platform cannot allocate resources to place the call.consultation The platform does not support the URI format used. This may be used to 21 of 32 11/15/2010 2:50 PM .connection.connection.disconnect.transfer. Prompts may be included before or within the <transfer> element.2 of [VXML2]) will contain the string "The error.baddestination error.2 Consultation Transfer Errors and Events One of the following events may be thrown during a consultation transfer: Event connection.disconnect.disconnect.connection.connection. one of the following errors will be thrown: Error error.nnn error.hangup The caller hung up.transfer another line and will not return.noresource Reason The caller is not allowed to call the destination.connection.transfer The caller was transferred to another line and will not return.connection events. Reason Table 13: Events thrown during consultation transfer If a consultation transfer could not be made.3 Example of a Consultation Transfer The following example attempts to perform a consultation transfer of the caller to a another party.2. connection.Voice Extensible Markup Language (VoiceXML) 2. Table 14: Consultation transfer attempt error events 9.noauthorization error. Table 12: Consultation Transfer Outcome After Connection Has Been Established 9.w3. The platform is not able to place a call to the destination.noroute error.1 http://www. error.org/TR/2005/CR-voicexml21-20050613/ The possible outcomes for a consultation transfer once the connection to the callee is established are: Action transfer begins Value of form item variable Event Reason The caller was transferred to undefined connection.protocol. The special variable _message (section 5. The destination URI is malformed.uri URI x is not a supported URI format" where x is the URI from the dest or destexpr <transfer> attributes. The platform does not support consultation transfer. The protocol stack for this connection raised an exception that does not correspond to one of the other error.unsupported.unsupported.

queued and played before starting the transfer --> <prompt> Please wait.1" xmlns="http://www.w3. the audio will stop playing immediately upon far-end answer.far-end answered --> <log> Connection with the callee established: transfer executed. The "transferaudio" attribute specifies an audio file to be played to the caller in place of audio from the far-end until the far-end answers.. </prompt> <filled> <if cond="mycall == 'busy'"> <prompt> Riley's line is busy.0" encoding="UTF-8"?> <vxml version="2. After the prompt queue is flushed.</log> </catch> <form id="consultation_xfer"> <block> <!-. If the audio source is longer than the connect time.w3.. </prompt> </block> <!-. Please call again later. and the <prompt> within <transfer> are queued and played before actually performing the transfer.Wait up to 60 seconds for the far end to answer --> <transfer name="mycall" dest="tel:+1-555-123-4567" transferaudio="music.transfer"> <!-. </prompt> <elseif cond="mycall == 'noanswer'"/> 22 of 32 11/15/2010 2:50 PM .queued and played before starting the transfer --> <prompt> Calling Riley. the outgoing call is initiated. with a notice such as "Please wait while we transfer your call.1 http://www.org/TR/2005/CR-voicexml21-20050613/ inform the caller of what is happening.Voice Extensible Markup Language (VoiceXML) 2.Play music while attempting to connect to far-end --> <!-.disconnect.wav" connecttimeout="60s" type="consultation"> <!-. Figure 2: Sequence and timing during an example of a consultation transfer <?xml version="1.org/2001/vxml"> <catch event="connection." The <prompt> within the <block>.

vxml-grammar-extension.xsd: the name attribute is now 23 of 32 11/15/2010 2:50 PM . the definition of the <mark> element has been modified in synthesis-core.xsd: this schema references the no-namespace schema of the Speech Recognition Grammar Specification 1.xsd: this schema references the no-namespace schema of the Speech Synthesis Markup Language 1.org/TR/2005/CR-voicexml21-20050613/ <prompt> Riley can't answer the phone now. Note: The VoiceXML DTD includes modified elements from the DTDs of the Speech Recognition Grammar Specification 1.org/TR/voicexml21/vxml.0 [SSML] and extends as well as restricts some of its definitions for embedding in the VoiceXML namespace. B VoiceXML Schema This section is Normative. Please call again later.xsd and extends some of its definitions for VoiceXML. Note: In order to accomodate the addition of the nameexpr attribute. </prompt> </if> </filled> </transfer> <!-.submit call statistics to server --> <block> <submit namelist="mycall" next="/cgi-bin/report"/> </block> </form> </vxml> A VoiceXML Document Type Definition The VoiceXML DTD is located at http://www.0 [SRGS] and the Speech Synthesis Markup Language 1. The VoiceXML schema depends upon other schema defined in the VoiceXML namespace: vxml-datatypes. the VoiceXML DTD does not correctly express that the <metadata> element can contain elements from other XML namespaces.w3. vxml-synthesis-extension. vxml-synthesis-restriction.xsd.w3.dtd.org/TR/voicexml21/vxml.1 http://www. The complete set of Speech Interface Framework schema required for VoiceXML 2.xsd and extends some of its definitions for VoiceXML.xsd: this schema references vxml-grammar-restriction.xsd: this schema references vxml-synthesis-restriction.1 is available here.0 [SRGS] and restricts some of its definitions for embedding in the VoiceXML namespace.Voice Extensible Markup Language (VoiceXML) 2.xsd: definition of attributes and attribute groups used in VoiceXML schema vxml-grammar-restriction. Due to DTD limitations.w3. The VoiceXML schema is located at http://www.xsd: definition of datatypes used in VoiceXML schema vxml-attribs.0 [SSML].

1 DTD using its Formal Public Identifier.xsd"> <form> <block>hello</block> </form> </vxml> Note that in this example. An XML declaration like the one above is not required in all XML documents. There may be a DOCTYPE declaration in the document prior to the root element. It is recommended that the <vxml> element also include "xmlns:xsi" and "xsi:schemaLocation" attributes to indicate the location of the schema for the VoiceXML namespace. C Conformance This section is normative. The DTD subset must not be used to override any parameter entities in the DTD.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3. If present.1".1 Conforming VoiceXML 2. If the "xsi:schemaLocation" attribute is present.w3.w3. VoiceXML document authors are strongly encouraged to use XML declarations in all their documents. 24 of 32 11/15/2010 2:50 PM . the recommended "xmlns:xsi" and "xsi:schemaLocation" attributes are included as is an XML declaration.1 document: <?xml version="1.w3.org/2001/vxml http://www. 3.1 Schema: xsi:schemaLocation="http://www. The namespace for VoiceXML is defined to be http://www. C. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16 and no encoding was determined by a higher-level protocol. 4.org/TR/voicexml21/vxml.w3.org/2001/vxml http://www.org/TR/voicexml21/vxml.org/TR/2005/CR-voicexml21-20050613/ optional.dtd"> The system identifier may be modified appropriately.w3. The <vxml> element must include a "version" attribute with the value "2.org/TR/voicexml21/vxml.1 Document A conforming VoiceXML 2.org/2001/vxml" xmlns:xsi="http://www.w3.1//EN" "http://www. the public identifier included in the DOCTYPE declaration must reference the VoiceXML 2. it must include a reference to the VoiceXML 2.0" encoding="UTF-8"?> <vxml version="2.1 http://www. The <vxml> element must designate the VoiceXML namespace using the "xmlns" attribute [XMLNAMES].Voice Extensible Markup Language (VoiceXML) 2. <!DOCTYPE vxml PUBLIC "-//W3C//DTD VOICEXML 2.1" xmlns="http://www.xsd" 6. Here is an example of a Conforming VoiceXML 2.1 document is a well-formed [XML] document that requires only the facilities described as mandatory in this specification and in [VXML2].org /2001/vxml. 5. 2. The document must conform to the constraints expressed in the VoiceXML 2.w3.1 Schema The root element of the document must be <vxml>.w3. Such a document must meet all of the following criteria: 1.

no conformance requirement with respect to performance characteristics of the VoiceXML 2. It is not required that a Conforming VoiceXML 2. When a Conforming VoiceXML 2.0 or 2. Interpreters that support both VoiceXML 2. The handling of a single application that mixes VoiceXML 2. its behavior is undefined. the XML parser must be able to parse and process all well-formed XML constructs defined within [XML] and [XMLNAMES].1 are orthogonal additions to [VXML2]. A Conforming VoiceXML 2. A Conforming VoiceXML 2. a VoiceXML application should not mix documents of both types.0 and VoiceXML 2.1 Processor encounters a non-Conforming VoiceXML 2.1 processor use a validating parser.1 documents as defined above.1 Processor must be a Conforming Speech Synthesis Markup Language Processor [SSML] and a Conforming XML Grammar Processor [SRGS] except for differences described in this document.unsupported. C.badfetch" event must be thrown. When a Conforming VoiceXML 2. a Conforming VoiceXML 2.1 must support the ability to transition from an application of one version to an application of another version. While the features of VoiceXML 2.1 Processors A VoiceXML 2. the amount of character data. Reasonable behavior in this case ranges the gamut from successful execution to the throwing of an error. Note: 25 of 32 11/15/2010 2:50 PM . If a syntax error is detected while processing a grammar document.1 Processor encounters a Conforming VoiceXML 2. In a Conforming VoiceXML 2.1 document.badfetch" event. and which cannot be processed. There are no maximum values on the number of elements. There is.<element>' for any VoiceXML element which must be supported when processing a Conforming VoiceXML 2. Consequently. Future work by W3C will address ways to specify conformance for documents involving multiple namespaces.1 documents.1 Processor.1 Processor.1 http://www.org/TR/2005/CR-voicexml21-20050613/ The VoiceXML language or these conformance criteria provide no designated size limits on any aspect of VoiceXML 2.1 Document with non-VoiceXML elements or attributes which are proprietary.2 Using VoiceXML with other namespaces The VoiceXML namespace may be used with other XML namespaces as per [XMLNAMES].Voice Extensible Markup Language (VoiceXML) 2. or defined in a non-VoiceXML namespace. or the number of characters in attribute values. however.w3.1 Processor must not throw an 'error. then it must throw an "error.1 functionality is platform-specific.1 Document.1 Processor must support the syntax and semantics of all VoiceXML elements as described in this document and in [VXML2]. although such documents are not strictly conforming VoiceXML 2. When a Conforming VoiceXML 2.1 Processor encounters a document with a root element designating a namespace other than VoiceXML. its behavior is undefined.3 Conforming VoiceXML 2.0 and VoiceXML 2.1 processor is a user agent that can parse and process Conforming VoiceXML 2. C. then an "error. defined only in versions of VoiceXML earlier than [VXML2].1 documents.

INVALID_STATE_ERR This constant is of type Number and its value is 11. Object Document Document has all the properties and methods of the Node object as well as the properties and methods defined below. 26 of 32 11/15/2010 2:50 PM .NOT_FOUND_ERR This constant is of type Number and its value is 8. The Document object has the following properties: documentElement This read-only property is a Element object. The namespaceURI parameter is of type String .w3. DOMException.DOMSTRING_SIZE_ERR This constant is of type Number and its value is 2.1 http://www.NO_MODIFICATION_ALLOWED_ERR This constant is of type Number and its value is 7. D ECMAScript Language Binding for DOM This appendix contains the ECMAScript binding for the subset of Level 2 of the Document Object Model exposed by the <data> element. The elementId parameter is of type String . DOMException. localName) This method returns a NodeList object.NOT_SUPPORTED_ERR This constant is of type Number and its value is 9. DOMException. DOMException. The object has the following methods: getElementsByTagName(tagname) This method returns a NodeList object. Implementers should reference [RFC 3987] and the [CHARMODEL] in order to provide appropriate support for these characters in VoiceXML documents and when processing values of this type or mapping them to URIs. The DOMException object has the following properties: code This property is of type Number. DOMException. Prototype Object DOMException The DOMException class has the following constants: DOMException. The localName parameter is of type String .org/TR/2005/CR-voicexml21-20050613/ The xsd:anyURI type and thus URI references in VoiceXML documents may contain a wide array of international characters. The tagname parameter is of type String . getElementsByTagNameNS(namespaceURI.Voice Extensible Markup Language (VoiceXML) 2. getElementById(elementId) This method returns a Element object.INDEX_SIZE_ERR This constant is of type Number and its value is 1.

org/TR/2005/CR-voicexml21-20050613/ Prototype Object Node The Node class has the following constants: Node. localName This read-only property is of type String.ATTRIBUTE_NODE This constant is of type Number and its value is 2. firstChild This read-only property is a Node object. prefix This property is of type String. The object has the following methods: 27 of 32 11/15/2010 2:50 PM . parentNode This read-only property is a Node object. namespaceURI This read-only property is of type String. childNodes This read-only property is a NodeList object. Node. Node. attributes This read-only property is a NamedNodeMap object. Node.TEXT_NODE This constant is of type Number and its value is 3. Node.PROCESSING_INSTRUCTION_NODE This constant is of type Number and its value is 7.ENTITY_REFERENCE_NODE This constant is of type Number and its value is 5. nodeValue This property is of type String.w3. This property can raise a DOMException object on retrieval. ownerDocument This read-only property is a Document object.COMMENT_NODE This constant is of type Number and its value is 8. Node.ELEMENT_NODE This constant is of type Number and its value is 1. Node. previousSibling This read-only property is a Node object. lastChild This read-only property is a Node object. The Node object has the following properties: nodeName This read-only property is of type String.CDATA_SECTION_NODE This constant is of type Number and its value is 4.1 http://www. nextSibling This read-only property is a Node object. nodeType This read-only property is of type Number. Node.DOCUMENT_NODE This constant is of type Number and its value is 9.Voice Extensible Markup Language (VoiceXML) 2.

1 http://www. count) This method returns a String. The name parameter is of type String . Object NodeList The NodeList object has the following properties: length This read-only property is of type Number. The count parameter is of type Number . This property can raise a DOMException object on retrieval. The localName parameter is of type String . Object CharacterData CharacterData has all the properties and methods of the Node object as well as the properties and methods defined below. The offset parameter is of type Number . The object has the following methods: getNamedItem(name) This method returns a Node object. The namespaceURI parameter is of type String . Object NamedNodeMap The NamedNodeMap object has the following properties: length This read-only property is of type Number.w3. hasAttributes() This method returns a Boolean. The index parameter is of type Number . 28 of 32 11/15/2010 2:50 PM . localName) This method returns a Node object. The object has the following methods: substringData(offset. length This read-only property is of type Number. The index parameter is of type Number .org/TR/2005/CR-voicexml21-20050613/ hasChildNodes() This method returns a Boolean. The object has the following methods: item(index) This method returns a Node object. item(index) This method returns a Node object. getNamedItemNS(namespaceURI.Voice Extensible Markup Language (VoiceXML) 2. The CharacterData object has the following properties: data This property is of type String.

getElementsByTagNameNS(namespaceURI.org/TR/2005/CR-voicexml21-20050613/ This method can raise a DOMException object. localName) This method returns a Attr object. ownerElement This read-only property is a Element object. specified This read-only property is of type Boolean. The namespaceURI parameter is of type String . The name parameter is of type String . The name parameter is of type String .1 http://www. The namespaceURI parameter is of type String . The Element object has the following properties: tagName This read-only property is of type String. localName) This method returns a NodeList object. getAttributeNodeNS(namespaceURI. The name parameter is of type String . value This property is of type String. Object Element Element has all the properties and methods of the Node object as well as the properties and methods defined below. Object Attr Attr has all the properties and methods of the Node object as well as the properties and methods defined below. localName) This method returns a String. hasAttribute(name) This method returns a Boolean. The localName parameter is of type String .Voice Extensible Markup Language (VoiceXML) 2. The localName parameter is of type String . The Attr object has the following properties: name This read-only property is of type String. 29 of 32 11/15/2010 2:50 PM . getElementsByTagName(name) This method returns a NodeList object. getAttributeNode(name) This method returns a Attr object. The namespaceURI parameter is of type String . The localName parameter is of type String . getAttributeNS(namespaceURI. The name parameter is of type String . The object has the following methods: getAttribute(name) This method returns a String.w3.

ed. Object Comment Comment has all the properties and methods of the CharacterData object . SSML 30 of 32 11/15/2010 2:50 PM .w3. Object Text Text has all the properties and methods of the CharacterData object . E References E. Object EntityReference EntityReference has all the properties and methods of the Node object . W3C Recommendation.org/TR/2004 /REC-speech-grammar-20040316/. Arnaud Le Hors et al.w3. The ProcessingInstruction object has the following properties: target This read-only property is of type String.1 Normative References DOM2 DOM Level 2. See http://www. data This property is of type String.1 http://www. Object ProcessingInstruction ProcessingInstruction has all the properties and methods of the Node object as well as the properties and methods defined below. See http://www. ed. SRGS Speech Recognition Grammar Specification Version 1. localName) This method returns a Boolean. The localName parameter is of type String . March 2004. The namespaceURI parameter is of type String .org/TR/2005/CR-voicexml21-20050613/ hasAttributeNS(namespaceURI.org/TR/DOM-Level-2-Core/. Andrew Hunt and Scott McGlashan W3C Recommendation.w3.Voice Extensible Markup Language (VoiceXML) 2. November 2000.0. Object CDATASection CDATASection has all the properties and methods of the Text object .

R.Voice Extensible Markup Language (VoiceXML) 2. XML Extensible Markup Language (XML) 1. See http://www.org/TR/2005 /NOTE-access-control-20050613/. March 2004. See http://www.pdf. September 1999. ed. IETF RFC 2616. Matt Oshry et al.0. W3C Working Draft.org/rfc/rfc3987. Bradner. Daniel C. W3C Recommendation.com /cpetesting/pdf/tr50075. Burnett et al. ed. Dave Raggett et al. March 1997.ietf. ed. S.txt. M.txt. RFC2616 Hypertext Transfer Protocol -. See http://www. May 1995. ed. ed.w3. June 2005.att.org/TR/2004/REC-xml-20040204/.org/TR/2004 /CR-charmod-resid-20041122/. W3C Recommendation. Voxeo Corporation 31 of 32 11/15/2010 2:50 PM .w3. January 2005. See http://www.mci.Part 1: Protocol specification. CHARMODEL Character Model for the World Wide Web 1.org/.01.w3. DATA_AUTH Authorizing Read Access to XML Content Using the <?access-control?> Processing Instruction. See http://www.org/TR/1999/REC-xml-names-19990114/. Tellme Networks RJ Auburn.org/TR/1999/REC-html401-19991224/. June 1999. Martin Duerst et al. ed. See http://www. See http://www. ETSI300_369 ETS 300 369-1: Integrated Services Digital Network (ISDN). Tim Bray et al.org/TR/2003/CR-speech-synthesis-20031218/.1 http://www.1.com/wholesale/us/voice /enhancedcallrouting/. ed. ed.1 was written by the participants in the W3C Voice Browser Working Group. See http://www. November 2004.org/rfc/rfc2616.w3. February 2004.txt.w3.org/TR/2004/REC-voicexml20-20040316/. E.ietf.w3. December 2002.Explicit Call Transfer (ECT) supplementary service. December 1999. See http://global. E.0. See http://www. RFC2119 Key words for use in RFCs to Indicate Requirement Levels. XMLNAMES Namespaces in XML.HTTP/1.ietf.2 Other References ATT_50075 AT&T Toll Free Transfer Connect (TR 50075).w3.Digital Subscriber Signalling System No. January 1999. Fielding et al. MCI_ECR MCI Enhanced Call Routing. See http://www. W3C Candidate Recommendation.org/TR/2005/CR-voicexml21-20050613/ Speech Synthesis Markup Language. HTML4 HTML 4.w3. Tim Bray et al. Duerst.org/rfc/rfc2119. W3C Note. one (DSS1) protocol.etsi. VXML2 VoiceXML 2. Scott McGlashan et al. ed. RFC3987 Internationalized Resource Identifiers (IRIs). W3C Recommendation. W3C Recommendation.0: Resource Identifiers. ed. See http://www. The following have significantly contributed to writing this specification: Matt Oshry. See http://www.3 Acknowledgements VoiceXML 2.

32 of 32 11/15/2010 2:50 PM . Made HTML4 ref informative. 'may'. HeyAnita Jim Ferrans. Clarified relationship between fetchaudio and mark-related lastresult$ properties and shadow variables. Clarified scope in which grammar srcexpr expression is evaluated.Voice Extensible Markup Language (VoiceXML) 2. Loquendo Michael Bodell. Clarified lastresult$ and shadow variable assignment behavior with respect to utterance recordings. Replaced script srcexpr example. Motorola Jeff Haynie. IBM Rob Marchand. Added note to schema and Appendix C. Added datafetchhint. Added normative reference to RFC 2119 and described usage of 'must'. Daniel C. Replaced grammar srcexpr example2. Tellme Networks David Burke. Invited Expert Emily Candell. Loquendo Milan Young. fetchaudio. Loquendo Davide Tosello. VoiceGenie Jeff Kusnitz. Vocalocity Matt Henry. and datamaxage properties and specified defaults for fetchtimeout. Added informative references to transfer specifications similar to consultation type transfer. maxstale. Hewlett-Packard Brien Muschett. datamaxstale. Vocalocity Laura Ricotti. Comverse Ken Davies. 'should' in Status Added Elements table. Moved description of mechanism for securing access to XML data (access-control PI) to W3C NOTE.org/TR/2005/CR-voicexml21-20050613/ Paolo Baggia. The schema and DTD were updated to reflect that the name attribute on data is optional.1 http://www. Tellme Networks Ken Rehor.w3. Voxeo Corporation Hakan Kilic. Burnett. and maxage properties of <data>. IBM Brad Porter. Scansoft Scott McGlashan. Nuance F Summary of changes since the Last Call Working Draft The following is a summary of the major changes since the Last Call Working Draft was published. fetchhint. Voxpilot Ltd.3 regarding support for international characters in URIs. Clarified interaction between interpreter and interpreter context when both disconnect namelist and exit namelist occur.

Sign up to vote on this title
UsefulNot useful