public override void SetXsltContext(XsltContext context) {
if (context == null) {
throw XPathException.Create(Res.Xp_NoContext);
}
if (this.xsltContext != context) {
xsltContext = context;
foreach (Query argument in args) {
argument.SetXsltContext(context);
}
XPathResultType[] argTypes = new XPathResultType[args.Count];
for(int i = 0; i < args.Count; i ++) {
argTypes[i] = args[i].StaticType;
}
function = xsltContext.ResolveFunction(prefix, name, argTypes);
// KB article allows to return null, see http://support.microsoft.com/?kbid=324462#6
if (function == null) {
throw XPathException.Create(Res.Xp_UndefFunc, QName);
}
}
}