SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
| Introduction
| Writing extension functions in Java
| Converting Arguments to Java Extension Functions
| Converting the Result of a Java Extension Function
» | Writing extension functions for .NET
| Converting Arguments to .NET Extension Functions
| Converting the Result of a .NET Extension Function
| Writing XSLT extension instructions
| Customizing Serialization
| Implementing a collating sequence
| Localizing numbers and dates
| Adding an output encoding
| Writing a URI Resolver for Input Files
| Writing a URI Resolver for Output Files
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# Calling .NET Constructors

.NET class constructors are called by using the function named `new()`. If there are several constructors, then again the system tries to find the one that is the best fit, according to the types of the supplied arguments. The result of calling `new()` is an XPath value whose type is denoted by a QName whose local name is the actual .NET class (for example `System.Data.SqlClient.SqlConnection` or `System.Collections.ArrayList`) and whose namespace URI is `http://saxon.sf.net/clitype`. The only things that can be done with a wrapped .NET Object are to assign it to a variable, to pass it to an extension function, and to convert it to a string or boolean, using the rules given below.

The use of external object types in namespace `http://saxon.sf.net/clitype` reflects the .NET type hierarchy. For example, if a variable is declared to accept a type of `net:System.Collections.IList`, then a value of type `net:System.Collections.ArrayList` will be accepted, but a value of type `net:System.Collections.HashTable` will not.

Next