March 4, 2021
Hot Topics:

Excerpt: Early Adopter VoiceXML: VoiceXML with XSLT (HTML and WML)

  • By Developer.com Staff
  • Send Email »
  • More Articles »
<myrubberbands export_type="single"> 
The thing we are most interested is a customer record, because that will be the set of data needed to generate the voice interface for querying order status. Since we might have more than one customer in a file, each individual <customer> and their associated order history will be contained by a <customer_record> element. Note that the time stamps are in XSL's standard format, and won't translate easily for rendering by a TTS engine. The <customer_record> element that starts here is very lengthy, and is not closed until the associated addresses and order history that follows have been given.
<customer id="1">     
As shown in the database schema, a customer can have one or more addresses. The XML representation should preserve the foreign key relationship with the customer table, and this relationship should not be dependent on the position of the elements. In this case, for example, both the customer profile and all associated addresses are nested within the <customer_record> tag. This is why all of the <customer_address> elements carry the customer_id attribute inside: it mirrors the relationship between the customer and customer_address tables in the database schema.

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" 
<address1>4321 La Place Ct</address1>     
<address2>Ste 306</address2>     
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.

Join us next week for more of Chapter 7 from Early Adopter VoiceXML.

This book excerpt comes to us from WROX Press--technical books that you can count on!

Page 5 of 5

This article was originally published on January 1, 2002

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date