W3C home > Mailing lists > Public > www-voice@w3.org > April to June 2006

VXML 2.1 and parsing of XML data

From: Christopher Passaretti <cpassar@nortel.com>
Date: Tue, 30 May 2006 18:17:57 -0400
Message-ID: <4ED8BBA17FC7DA41A34E1B0975DEC98C0C13DA92@zrtphxm2.corp.nortel.com>
To: <www-voice@w3.org>

For the <data> tag in the VoiceXML 2.1 specification, if the name
attribute
is set, then platforms must support XML parsing into a DOM.  The spec
later
talks about exposing the data as specified in Appendix D.

Its not clear to me why we are using the old style format for parsing
the DOM 
tree.  ECMA-357 (XML E4X) provides an alternative access method to parse
the DOM tree.

Given we have this XML string:

<?xml version="1.0" encoding="UTF-8"?> <?access-control
allow="*.roadrunner.edu *.acme.edu"?> <quote> <ticker>F</ticker>
<name>Ford Motor Company</name> <change>1.00</change> <last>30.00</last>
</quote> 

As specified by Appendix D, the price can be accessed via:
var price =
quote.documentElement.getElementsByTagName("last").item(0).firstChild.da
ta;

Using ECMA-357, it can be accessed as follows:

var price = quote.last[0];

Furthermore, the ECMA-357 spec states that E4X implementations are not
required to support the W3C DOM 
or to provide the capability to construct XML objects from W3C DOM
objects.   It would seem we could support
the simpler approach and make the DOM approach optional.

Christopher F. Passaretti
Software Product Development Manager
Nortel
cpassar@nortel.com
Office 1.631.285.2529 (ESN 297)
Fax    1.631.737.8505
Received on Thursday, 1 June 2006 01:52:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 30 October 2006 12:49:02 GMT