Calling Functions in Queries

The XPath processor provides many functions that you can call in a query. This section provides some examples to give you a sense of how functions in queries work. Many subsequent sections provide information about invoking functions in queries. For a complete list of the functions you can call in a query, see XPath Functions Quick Reference.

Following is a query that returns a number that indicates how many book elements are in the document:

count(//book)
               

            

In format descriptions, a question mark that follows an argument indicates that the argument is optional. For example:

string substring(string, number, number?) 
               

            

This function returns a string. The name of the function is substring. This function takes two required arguments (a string followed by a number) and one optional argument (a number).

XQuery Mapper

Stylus Studio has the industry's only XQuery mapper, enabling you to develop sophisticated XML mappings consisting of queries and data transformation in an intuitive, visual manner.

XQuery Editor

Stylus Studio's XQuery development tools are a tremendous help in building and testing XML applications requiring a standards-based approach to querying, integrating and transforming data from various distributed data sources.

Web Service Testing Tools

The Stylus Studio Web Service Tester allows you to easily locate, build references to, and test Web services for XML applications based on WSDL, SOAP, and UDDI standard Web service technologies.

Binary XML

How do I get my binary data into XML? How do I get my binary data out of XML? The answers to these questions and more in this amazing Binary XML tutorial.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member