System.Xml.Xsl.XsltOld.XsltCompileContext.EvaluateKey C# (CSharp) Method

EvaluateKey() private static method

private static EvaluateKey ( XPathNavigator node, Query matchExpr, string matchStr, Query useExpr, Hashtable keyTable ) : void
node System.Xml.XPath.XPathNavigator
matchExpr MS.Internal.Xml.XPath.Query
matchStr string
useExpr MS.Internal.Xml.XPath.Query
keyTable System.Collections.Hashtable
return void
        private static void EvaluateKey(XPathNavigator node, Query matchExpr, string matchStr, Query useExpr, Hashtable keyTable) {
            try {
                if (matchExpr.MatchNode(node) == null) {
                    return;
                }
            } catch(XPathException) {
                throw XsltException.Create(Res.Xslt_InvalidPattern, matchStr);
            }
            object result = useExpr.Evaluate(new XPathSingletonIterator(node, /*moved:*/true));
            XPathNodeIterator it = result as XPathNodeIterator;
            if (it != null) {
                bool checkDuplicates = false;
                while (it.MoveNext()) {
                    AddKeyValue(keyTable, /*key:*/it.Current.Value, /*value:*/node, checkDuplicates);
                    checkDuplicates = true;
                }
            } else {
                String key = XmlConvert.ToXPathString(result);
                AddKeyValue(keyTable, key, /*value:*/node, /*checkDuplicates:*/ false);
            }
        }