Saxon.Api

Class DocumentBuilder

Class DomDestination

Class DynamicContext

Class DynamicError

Class EmptyEnumerator

Class ExtensionFunctionCall

Class ExtensionFunctionDefinition

Class NullDestination

Class Processor

Class QName

Class SchemaManager

Class SchemaValidator

Class Serializer

Class StaticContext

Class StaticError

Class TextWriterDestination

Class XPathCompiler

Class XPathExecutable

Class XPathSelector

Class XQueryCompiler

Class XQueryEvaluator

Class XQueryExecutable

Class XdmAnyFunctionType

Class XdmAnyItemType

Class XdmAnyNodeType

Class XdmAtomicType

Class XdmAtomicValue

Class XdmDestination

Class XdmEmptySequence

Class XdmItem

Class XdmItemType

Class XdmNode

Class XdmNodeKind

Class XdmSequenceType

Class XdmValue

Class XmlDestination

Class XsltCompiler

Class XsltExecutable

Class XsltTransformer

Enum RecoveryPolicy

Enum SchemaValidationMode

Enum TreeModel

Enum WhitespacePolicy

Enum XdmAxis

Interface IMessageListener

Interface IQueryResolver

Interface IResultDocumentHandler

Interface IXdmEnumerator

Interface IXmlLocation

Interface SchemaResolver

 

Saxon.Api
Class ExtensionFunctionDefinition


public abstract class ExtensionFunctionDefinition
implements object

Abstract superclass for user-written extension functions. An extension function may be implemented as a subclass of this class, with appropriate implementations of the defined methods.

More precisely, a subclass of ExtensionFunctionDefinition identifies a family of extension functions with the same (namespace-qualified) name but potentially having different arity (number of arguments).


Property Summary
 QName FunctionName

Read-only property returning the name of the extension function, as a QName.

 int MinimumNumberOfArguments

Read-only property giving the minimum number of arguments in a call to this extension function.

 int MaximumNumberOfArguments

Read-only property giving the maximum number of arguments in a call to this extension function.

 XdmSequenceType[] ArgumentTypes

Read-only property giving the required types of the arguments to this extension function. If the number of items in the array is less than the maximum number of arguments, then the last entry in the returned ArgumentTypes is assumed to apply to all the rest; if the returned array is empty, then all arguments are assumed to be of type item()*

 Boolean TrustResultType

This property may be set to true in a subclass if it guarantees that the returned result of the function will always be of the declared return type: setting this to true by-passes the run-time checking of the type of the value, together with code that would otherwise perform atomization, numeric type promotion, and similar conversions. If the value is set to true and the value is not of the correct type, the effect is unpredictable and probably disastrous.

 Boolean DependsOnFocus

This property must be set to true in a subclass if the evaluation of the function makes use of the context item, position, or size from the dynamic context. This inhibits certain Saxon optimizations.

 Boolean HasSideEffects

This property should be set to true in a subclass if the evaluation of the function has side-effects. Saxon never guarantees the result of calling functions with side-effects, but if this property is set, then certain aggressive optimizations will be avoided, making it more likely that the function behaves as expected.

 
Method Summary
 XdmSequenceType ResultType(Saxon.Api.XdmSequenceType[] ArgumentTypes)

Method returning the declared type of the return value from the function. The type of the return value may be known more precisely if the types of the arguments are known (for example, some functions return a value that is the same type as the first argument. The method is therefore called supplying the static types of the actual arguments present in the call.

 ExtensionFunctionCall MakeFunctionCall()

Factory method to create an ExtensionFunctionCall object, representing a specific function call in the XSLT or XQuery source code. Saxon will call this method once it has identified that a specific call relates to this extension function.

 
Property Detail

FunctionName

public QName FunctionName {}

Read-only property returning the name of the extension function, as a QName.


MinimumNumberOfArguments

public int MinimumNumberOfArguments {}

Read-only property giving the minimum number of arguments in a call to this extension function.


MaximumNumberOfArguments

public int MaximumNumberOfArguments {}

Read-only property giving the maximum number of arguments in a call to this extension function.


ArgumentTypes

public XdmSequenceType[] ArgumentTypes {}

Read-only property giving the required types of the arguments to this extension function. If the number of items in the array is less than the maximum number of arguments, then the last entry in the returned ArgumentTypes is assumed to apply to all the rest; if the returned array is empty, then all arguments are assumed to be of type item()*


TrustResultType

public Boolean TrustResultType {}

This property may be set to true in a subclass if it guarantees that the returned result of the function will always be of the declared return type: setting this to true by-passes the run-time checking of the type of the value, together with code that would otherwise perform atomization, numeric type promotion, and similar conversions. If the value is set to true and the value is not of the correct type, the effect is unpredictable and probably disastrous.


DependsOnFocus

public Boolean DependsOnFocus {}

This property must be set to true in a subclass if the evaluation of the function makes use of the context item, position, or size from the dynamic context. This inhibits certain Saxon optimizations.


HasSideEffects

public Boolean HasSideEffects {}

This property should be set to true in a subclass if the evaluation of the function has side-effects. Saxon never guarantees the result of calling functions with side-effects, but if this property is set, then certain aggressive optimizations will be avoided, making it more likely that the function behaves as expected.


Method Detail

ResultType

public XdmSequenceType ResultType(Saxon.Api.XdmSequenceType[] ArgumentTypes)

Method returning the declared type of the return value from the function. The type of the return value may be known more precisely if the types of the arguments are known (for example, some functions return a value that is the same type as the first argument. The method is therefore called supplying the static types of the actual arguments present in the call.

Parameters:
ArgumentTypes -
The static types of the arguments present in the function call
returns
An XdmSequenceType representing the declared return type of the extension function

MakeFunctionCall

public ExtensionFunctionCall MakeFunctionCall()

Factory method to create an ExtensionFunctionCall object, representing a specific function call in the XSLT or XQuery source code. Saxon will call this method once it has identified that a specific call relates to this extension function.

returns
An instance of the appropriate implementation of ExtensionFunctionCall