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;
}
}