XML
  Home arrow XML arrow Page 4 - Sample Chapter: Early Adopter VoiceXML
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

Sample Chapter: Early Adopter VoiceXML
By: Tim Pabst
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2002-09-04

    Table of Contents:
  • Sample Chapter: Early Adopter VoiceXML
  • VoiceXML With XSLT (HTML and WML)
  • System Architecture
  • System Architecture (contd.)
  • Generating MyRubberbandsML
  • Generating MyRubberbandsML (contd.)
  • Generating MyRubberbandsML (contd.)
  • Running the Stylesheet
  • Summary

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Sample Chapter: Early Adopter VoiceXML - System Architecture (contd.)


    (Page 4 of 9 )

    In this case, the database schema allows the customer_address table to store real physical addresses like billing and shipping addresses, or e-mail address for alternate methods of customer contact. Hence, the <customer_address> element can contain the optional <email> element.

    <customer_address address_type="Ship To Address"
    customer_id="1">
    <address1>4321 La Place Ct</address1>
    <address2>Ste 306</address2>
    <city>Carlsbad</city>
    <state_or_prov>CA</state_or_prov>
    <postalcode>92008</postalcode>
    <email></email>
    <phone>7605551212</phone>
    </customer_address>


    Since the main objective of the voice application is to allow the user access to their order history and status information, it makes sense to include the history inside the <customer_record> scope. In this case, because we will need to enunciate the order time, and because we'd rather not use XSL's limited text processing capabilities, we'll add the attribute sayas to the <order_date> element. This provides a pronunciation that can be used with the VoiceXML <sayas> tag for TTS. However, the desired pronunciation of the date and time cannot be derived from the database alone, as addressed in the section Generating MyRubberbandsML.

    <order_history
    customer_id="1">
    <order id="1">

    <customer_address address_type="Ship To Address"
    customer_id="1"/>
    <order_date
    sayas="May 18, 2001 at 16 17 hours">

    2001-05-18T16:17:16
    </order_date>
    <order_status>Processing</order_status>

    <tax>0.09</tax>

    <shipping_charge>0.4</shipping_charge>

    <total_charge>2.48</total_charge>
    <product
    id="1" quantity="3"/>
    <product
    id="3" quantity="1"/>
    </order>
    </order_history>


    Finally, to provide the user with detailed order information, the full product name and description must be available. This will also allow the user to ask for a product list, and eventually we can perhaps extend the interface to enable products to be ordered by voice. Note that the <product_list> is not associated with any particular <customer_record>.

    Also note that, ideally, the <product_list> wouldn't actually be in the same document as the customer data. However, we'll keep everything in one file here to avoid the issue of linking between documents. It might amuse us to picture the harried developers reaching the same conclusion to save time and give themselves some chance of meeting their beloved boss's deadline. Later on, they will no doubt want to refine the process and generate smaller XML documents that can be processed more quickly.

    </customer_record>
    <product_list>
    <product id="1" name="MIXED1000"
    price="1.99">
    Mixed Bag of 1000 Rubber Bands</product>
    <product id="2"
    name="MIXED5000" price="4.09">
    Mixed Bag of 5000 Rubber Bands</product>
    <product id="3"
    name="RED1000" price="2.19">
    Bag of 1000 Red Rubber Bands</product>
    <product id="4"
    name="RED10000" price="17.49">
    Bag of 10000 Red Rubber Bands</product>
    <product id="5"
    name="BLUE1000" price="0.99">
    Bag of 1000 Blue Rubber Bands</product>
    <product id="6"
    name="BLUE10000" price="8.99">
    Bag of 10000 Blue Rubber Bands</product>
    </product_list>
    </myrubberbands>


    This example is formatted to fit the space above, and for readability, adds quite a bit of whitespace between <product></product> tags that would probably not occur in a real document.

    More XML Articles
    More By Tim Pabst


     

    XML ARTICLES

    - Datatypes and More in RELAX NG
    - Providing Options in RELAX NG
    - An Introduction to RELAX NG
    - Path, Predicates, and XQuery
    - Using Predicates with XQuery
    - Navigating Input Documents Using Paths
    - XML Basics
    - Introduction to XPath
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE
    - UI Design with Java and XML Toolkits
    - Displaying ADO Retrieved Data with XML Islan...
    - Widget Walkthrough
    - Introduction to Widgets
    - The Why and How of XML Data Islands







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway