<%@ page language="C#" masterpagefile="~/templates/Documentation.master" inherits="Page" pagetitle="How the collection() Function is Processed" keywords="How the collection() Function is Processed"%>

How the collection() Function is Processed

The Stylus Studio built-in and DataDirect XQuery® processors process collection() functions differently:

Because it processes XQuery as SQL on the database server, the DataDirect XQuery® processor can provide performance superior to that of other XQuery processors when querying relational data as XML.

Database Connections

The database connection is established when the XQuery code is executed and closed as soon as a result is returned. Connection settings used are those associated with the data source used to create the XQuery. See Creating a Database Connection for more information on this topic.

Handling Invalid Characters

Some characters, like spaces, are valid in SQL but are invalid in XML. Invalid characters are escaped using SQL/XML escaping convention when the relational data is converted to XML. For example, Stylus Studio would create an XML tag for a column named last name as last_x0020_name.