How the collection() Function is Processed

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

  • The DataDirect XQuery processor converts the XQuery code to SQL statements and pushes the SQL directly to the database server. Results are returned to Stylus Studio as XML and displayed in the Preview window.
  • Stylus Studio's built-in processor retrieves the entire table or view, converts the data into XML, and evaluates the query against the XML.

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.

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.

Free Stylus Studio XML Training:
W3C Member