VoiceXML and the Voice-Driven Internet 
by David Houlding

Listing One
<?xml version="1.0"?>
<vxml application="http://resources.tellme.com/lib/universals.vxml">
<form id="Introduction">
  <block>
    <audio>Welcome to the TRC Product Browser.</audio>
    <pause>200</pause>
    <audio>Using this service you may browse products including books, music and video.</audio>
    <pause>200</pause>
    ><goto next="#ChooseProductType"/>
  </block>
</form


Listing Two
<form id="ChooseProductType">
 <field name="document.generic.ProductGroup">
  <grammar>
   <![CDATA[
           [
           [ (dtmf-1) book books] {<option "BOOKS">}
           [ (dtmf-2) music cd cds] {<option "MUSIC">}
           [ (dtmf-3) video videos movie dvd] {<option "VIDEO">}
           ]
   ]]>
  </grammar>
  <prompt>
   <audio>Please select a product type. Choose books, music or video now.</audio>
   <pause>2000</pause>
  </prompt>
  <filled>
   <result name="BOOKS">
     <audio>You selected books.</audio>
     <goto next="#ChooseBooksType"/>
   </result>
 ... 


Listing Three
<form id="ChooseBooksType">
 <field name="document.generic.ProductCategory">
  <grammar>
   <![CDATA[
           [
           [ (dtmf-1) architecture] {<option "BKS-ARCH">}
           [ (dtmf-2) art] {<option "BKS-ART">}
           ]
   ]]>
  </grammar>
  <prompt>
   <audio>Please select a book type. Choose architecture or art now.</audio>
   <pause>2000</pause>
  </prompt>
  <filled>
   <result name="BKS-ARCH">
     <audio>You selected architecture.</audio>
     <goto next="#DoSearch"/>
   </result>
 ... 


Listing Four
<form id="DoSearch">
  <block>
   <audio>I am now searching for products.</audio>
     <goto next="http://www.trcinc.com/ProductPresentationServlet.jrun" 
       method="post" submit="ProductGroup={document.generic.ProductGroup}&amp;
       ProductCategory={document.generic.ProductCategory}&amp;
       ClientType=VoicePortal"/>
  </block>
</form>


Listing Five
<?xml version="1.0"?>
<ProductList>
  <Product>
    <ID>7</ID>
    <Name>Invisible New York : The Hidden Infrastructure of the City 
                                      (Creating the North American</Name>
    <ShortDescription>Invisible New York : The Hidden Infrastructure of 
                   the City (Creating the North American</ShortDescription>
    <Cost>21.0</Cost>
    <Active>false</Active>
    <CreatedOn>2000-02-01 00:00:00.0</CreatedOn>
    <LastUpdateOn>2000-02-01 00:00:00.0</LastUpdateOn>
    <ImageURL>http://www.trcinc.com/mobile/images/books/invisiblenewyork.gif</ImageURL>
  </Product>
 ... 

Listing Six
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
processor.process( new XSLTInputSource( productDataInputStream ), new XSLTInputSource( stylesheetInputStream ), new XSLTResultTarget( transformationOutputStringWriter ) );




