System.Xml.Xsl.Runtime.XsltLibrary.CompareNodeSetAndValue C# (CSharp) Method

CompareNodeSetAndValue() private static method

private static CompareNodeSetAndValue ( ComparisonOperator op, IList nodeset, XPathItem val, TypeCode compType ) : bool
op ComparisonOperator
nodeset IList
val System.Xml.XPath.XPathItem
compType TypeCode
return bool
        private static bool CompareNodeSetAndValue(ComparisonOperator op, IList<XPathNavigator> nodeset, XPathItem val, TypeCode compType)
        {
            Debug.Assert(compType == TypeCode.Boolean || compType == TypeCode.Double || compType == TypeCode.String);
            if (compType == TypeCode.Boolean)
            {
                // Cast nodeset to boolean type, then take its ordinal number
                return CompareNumbers(op, (nodeset.Count != 0) ? 1 : 0, XsltConvert.ToBoolean(val) ? 1 : 0);
            }
            else
            {
                int length = nodeset.Count;
                for (int idx = 0; idx < length; idx++)
                {
                    if (CompareValues(op, nodeset[idx], val, compType))
                    {
                        return true;
                    }
                }
                return false;
            }
        }