Esempio n. 1
0
        /// <summary>
        /// Resolves a function reference and return an
        /// <see cref="IXsltContextFunction"/> representing the function. The
        /// <see cref="IXsltContextFunction"/> is used at execution time to get
        /// the return value of the function.
        /// </summary>
        /// <param name="prefix">The prefix of the function as it appears in
        /// the XPath expression</param>
        /// <param name="name">The name of the function</param>
        /// <param name="ArgTypes">An array of argument types for the function
        /// being resolved. This allows you to select between methods with the
        /// same name (for example, overloaded methods).</param>
        /// <returns>An <see cref="IXsltContextFunction"/> representing the
        /// function</returns>
        public override IXsltContextFunction ResolveFunction(string prefix,
                                                             string name, XPathResultType[] ArgTypes)
        {
            IXsltContextFunction function = null;

            switch (name)
            {
            case "matches-regex":
                function = new MatchesRegexFunction();
                break;

            case "resolve-name":
                function = new ResolveNameFunction();
                break;

            default:
                break;
            }

            return(function);
        }
Esempio n. 2
0
        /// <summary>
        /// Resolves a function reference and return an
        /// <see cref="IXsltContextFunction"/> representing the function. The
        /// <see cref="IXsltContextFunction"/> is used at execution time to get
        /// the return value of the function.
        /// </summary>
        /// <param name="prefix">The prefix of the function as it appears in
        /// the XPath expression</param>
        /// <param name="name">The name of the function</param>
        /// <param name="ArgTypes">An array of argument types for the function
        /// being resolved. This allows you to select between methods with the
        /// same name (for example, overloaded methods).</param>
        /// <returns>An <see cref="IXsltContextFunction"/> representing the
        /// function</returns>
        public override IXsltContextFunction ResolveFunction(string prefix,
          string name, XPathResultType[] ArgTypes)
        {
            IXsltContextFunction function = null;

            switch(name)
            {
                case "matches-regex":
                    function = new MatchesRegexFunction();
                    break;

                case "resolve-name":
                    function = new ResolveNameFunction();
                    break;

                default:
                    break;
            }

            return function;
        }