System\Xml\XPath\Internal\Function.cs (30)
73public override XPathResultType ReturnType
86internal static ReadOnlySpan<XPathResultType> ReturnTypes =>
88/* FunctionType.FuncLast */ XPathResultType.Number,
89/* FunctionType.FuncPosition */ XPathResultType.Number,
90/* FunctionType.FuncCount */ XPathResultType.Number,
91/* FunctionType.FuncID */ XPathResultType.NodeSet,
92/* FunctionType.FuncLocalName */ XPathResultType.String,
93/* FunctionType.FuncNameSpaceUri */ XPathResultType.String,
94/* FunctionType.FuncName */ XPathResultType.String,
95/* FunctionType.FuncString */ XPathResultType.String,
96/* FunctionType.FuncBoolean */ XPathResultType.Boolean,
97/* FunctionType.FuncNumber */ XPathResultType.Number,
98/* FunctionType.FuncTrue */ XPathResultType.Boolean,
99/* FunctionType.FuncFalse */ XPathResultType.Boolean,
100/* FunctionType.FuncNot */ XPathResultType.Boolean,
101/* FunctionType.FuncConcat */ XPathResultType.String,
102/* FunctionType.FuncStartsWith */ XPathResultType.Boolean,
103/* FunctionType.FuncContains */ XPathResultType.Boolean,
104/* FunctionType.FuncSubstringBefore */ XPathResultType.String,
105/* FunctionType.FuncSubstringAfter */ XPathResultType.String,
106/* FunctionType.FuncSubstring */ XPathResultType.String,
107/* FunctionType.FuncStringLength */ XPathResultType.Number,
108/* FunctionType.FuncNormalize */ XPathResultType.String,
109/* FunctionType.FuncTranslate */ XPathResultType.String,
110/* FunctionType.FuncLang */ XPathResultType.Boolean,
111/* FunctionType.FuncSum */ XPathResultType.Number,
112/* FunctionType.FuncFloor */ XPathResultType.Number,
113/* FunctionType.FuncCeiling */ XPathResultType.Number,
114/* FunctionType.FuncRound */ XPathResultType.Number,
115/* FunctionType.FuncUserDefined */ XPathResultType.Any
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (66)
111private static MethodInfo? FindBestMethod(MethodInfo[] methods, bool ignoreCase, bool publicOnly, string name, XPathResultType[]? argTypes)
161XPathResultType required = argTypes[par];
162if (required == XPathResultType.Any)
166XPathResultType actual = GetXPathType(parameters[par].ParameterType);
169actual != XPathResultType.Any // actual arg is object and we can pass everithing here.
187private FuncExtension? GetExtensionMethod(string ns, string name, XPathResultType[]? argTypes, out object? extension)
215public override IXsltContextFunction ResolveFunction(string prefix, string name, XPathResultType[] argTypes)
544public static XPathResultType GetXPathType(Type type)
549return XPathResultType.String;
551return XPathResultType.Boolean;
555return XPathResultType.Navigator;
559return XPathResultType.NodeSet;
562return XPathResultType.Any;
564return XPathResultType.Error;
567return XPathResultType.Number;
608private XPathResultType _returnType;
609private XPathResultType[] _argTypes = null!; // Used by derived classes which initialize it
613public XsltFunctionImpl(int minArgs, int maxArgs, XPathResultType returnType, XPathResultType[] argTypes)
619protected void Init(int minArgs, int maxArgs, XPathResultType returnType, XPathResultType[] argTypes)
629public XPathResultType ReturnType { get { return _returnType; } }
630public XPathResultType[] ArgTypes { get { return _argTypes; } }
713public static object ConvertToXPathType(object val, XPathResultType xt, Type type)
717case XPathResultType.String:
728case XPathResultType.Number: return ToNumeric(val, type);
729case XPathResultType.Boolean: return ToBoolean(val);
730case XPathResultType.NodeSet: return ToIterator(val);
732case XPathResultType.Any:
733case XPathResultType.Error:
744public FuncCurrent() : base(0, 0, XPathResultType.NodeSet, Array.Empty<XPathResultType>()) { }
753public FuncUnEntityUri() : base(1, 1, XPathResultType.String, new XPathResultType[] { XPathResultType.String }) { }
762public FuncGenerateId() : base(0, 1, XPathResultType.String, new XPathResultType[] { XPathResultType.NodeSet }) { }
787public FuncSystemProp() : base(1, 1, XPathResultType.String, new XPathResultType[] { XPathResultType.String }) { }
797public FuncElementAvailable() : base(1, 1, XPathResultType.Boolean, new XPathResultType[] { XPathResultType.String }) { }
807public FuncFunctionAvailable() : base(1, 1, XPathResultType.Boolean, new XPathResultType[] { XPathResultType.String }) { }
816public FuncDocument() : base(1, 2, XPathResultType.NodeSet, new XPathResultType[] { XPathResultType.Any, XPathResultType.NodeSet }) { }
855public FuncKey() : base(2, 2, XPathResultType.NodeSet, new XPathResultType[] { XPathResultType.String, XPathResultType.Any }) { }
937public FuncFormatNumber() : base(2, 3, XPathResultType.String, new XPathResultType[] { XPathResultType.Number, XPathResultType.String, XPathResultType.String }) { }
947public FuncNodeSet() : base(1, 1, XPathResultType.NodeSet, new XPathResultType[] { XPathResultType.Navigator }) { }
966XPathResultType returnType = GetXPathType(method.ReturnType);
972XPathResultType[] argTypes = new XPathResultType[parameters.Length];