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).

EDIFACT Reference

The EDIFACT Reference is a free developer resource providing the most in-depth information on EDIFACT constructs and data models.

XQuery Talk Blog

Get the latest XQuery news and information at XQuery-Talk - an online community for discussing XQuery technologies, examples, implementations and more. Bookmark this RSS or ATOM feed now!

Advertising & Marketing

Learn about top advertising and marketing companies that are leveraging Stylus Studio 2006 to enhance their everyday work experience.

Why XQuery - The Case for XQuery

Read "The Case for XQuery" - an article that debuted in the November 2005 issue of SOA WebServices Journal, written by Jerry King, Vice President of DataDirect Technologies.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member