Our next tutorial covers how we can use the very powerful addition of Xpath within our callXML 3.0 applications. As such, a brief primer on what Xpath is, and what it can do, is very likely in order. Xpath is an advanced XML specification that is meant to serve as a foundation for other XML-based markups, such as XPointer, XSLT, and the like. Paraphrased from the W3C specification:
"XPath 2.0 is an expression language that allows the processing of values conforming to the data model defined in XQuery 1.0 and XPath 1.0 Data Model. The data model provides a tree representation of XML documents as well as atomic values such as integers, strings, and booleans, and sequences that may contain both references to nodes in an XML document and atomic values. The result of an XPath expression may be a selection of nodes from the input documents, or an atomic value, or more generally, any sequence allowed by the data model. The name of the language derives from its most distinctive feature, the path expression, which provides a means of hierarchic addressing of the nodes in an XML tree. XPath 1.0 is a superset of [XPath 1.0], with the added capability to support a richer set of data types, and to take advantage of the type information that becomes available when documents are validated using XML Schema."
In the context of our next tutorial, we will explore how we can use XPath to fetch arbitrary data from an XML document, and pipe it into the CallXML application in a usable form. This is quite useful for a number of reasons. The primary one being, that in the past, we had to rely on a server-side backend to import data in this manner. With CallXML versions 2.0 and older, an application would need to have some ASP/PHP/JSP logic to perform this transaction, whereas with CallXML version 3.0, we can keep this logic entirely on the client-side. Strong with The Force, this one is.
Note that the voxeo implementation of Xpath is loosely based on the 1.0 specification at this time, and includes some enhancements to the list of available functions. However, do note that some built-in functions defined in the 1.0 specification are currently not supported, and as such, you should refer to the Voxeo Xpath documentation when you need answers to your Xpath questions.
Ready to ride the tiger? Let's start our education on Xpath now, and look at our tutorial, where we will build a 'virtual receptionist' application that will route calls based on voice recognition choices that are contained within a plain-vanilla XML 'source' document!
ANNOTATIONS: EXISTING POSTS
0 posts - click the button below to add a note to this page