/// <summary>
/// Implements the following function
/// boolean subset(node-set, node-set)
/// </summary>
/// <param name="nodeset1">An input nodeset</param>
/// <param name="nodeset2">Another input nodeset</param>
/// <returns>True if all the nodes in the first nodeset are contained
/// in the second nodeset</returns>
/// <remarks>THIS FUNCTION IS NOT PART OF EXSLT!!!</remarks>
public bool subset(XPathNodeIterator nodeset1, XPathNodeIterator nodeset2)
{
if (nodeset1.Count > 125 || nodeset2.Count > 125)
return subset2(nodeset1, nodeset2);
//else
XPathNavigatorIterator nodelist1 = new XPathNavigatorIterator(nodeset1, true);
XPathNavigatorIterator nodelist2 = new XPathNavigatorIterator(nodeset2, true);
foreach (XPathNavigator nav in nodelist1)
{
if (!nodelist2.Contains(nav))
{
return false;
}
}
return true;
}