Esempio n. 1
0
        /// <summary>
        ///  Sets value for a parameter.
        /// </summary>
        /// <param name="ns">The namespace URI of the XSLT parameter.</param>
        /// <param name="name">The local name of the XSLT parameter or an array of name =&gt; option pairs.</param>
        /// <param name="value">The new value of the XSLT parameter.</param>
        /// <returns><B>True</B> or <B>false</B>.</returns>
        public bool setParameter(string ns, PhpArray name, string value = null)
        {
            // set all name => value pairs contained in the array
            foreach (var pair in name)
            {
                if (!pair.Key.IsString)
                {
                    PhpException.Throw(PhpError.Warning, Resources.InvalidParameterKey);
                    return(false);
                }

                if (xsltArgumentList.GetParam(pair.Key.String, ns) != null)
                {
                    xsltArgumentList.RemoveParam(pair.Key.String, ns);
                }
                xsltArgumentList.AddParam(pair.Key.String, ns, XsltConvertor.PhpToDotNet(_ctx, pair.Value));
            }

            return(true);
        }
Esempio n. 2
0
 private object InvokeFunction(string name, params object[] args)
 {
     return(XsltConvertor.PhpToDotNet(_ctx, InvokeFunctionCore(name, args)));
 }