# Differences between Saxon-SA and Saxon-B

Some new features in this release are available only in the commercial version of the product, Saxon-SA.

The extra features in Saxon-SA include the following:

1. Saxon-SA incorporates a schema processor, and enables schema-aware XSLT and XQuery processing.

2. Saxon-SA includes support for higher-order functions. See the description of saxon:function for details. Higher-order functions enable full functional programming capability in XSLT and XQuery, allowing complex algorithms to be expressed concisely.

3. Saxon-SA includes extension functions, designed primarily for use in XQuery, that mimic the behavior of features found in XSLT but not in XQuery. Specifically:

   - saxon:analyze-string() enables powerful regular expression processing, allowing the creating of markup based on the lexical structure of the string

   - saxon:for-each-group() provides a grouping facility for XQuery

   - saxon:format-number() provides formatting capability for numbers

   - saxon:format-date() provides formatting capability for dates and times

4. Saxon-SA provides more comprehensive diagnostics on run-time errors. Specifically, when a fatal run-time error occurs, the error handler provides a stack trace showing the functions and templates that were active at the point of the error, in terms of their position in the source stylesheet or query.

5. Saxon-SA provides a try/catch capability: it is possible to trap run-time errors and recover from them.

6. Saxon-SA includes an optimized hash-join implementation of the GeneralComparison "=" operator in XPath. This is optimized for the case where the types of values are likely to be known, as is the case when the input documents have been validated against a schema; but it is also likely to give performance improvements in other cases, especially where the sequences being compared are lengthy. (Architectural changes have also been made that will allow the schema-aware product to include further performance optimizations in the future).

Next