System.Xml.Xsl.XsltOld.Processor.Matches C# (CSharp) Method

Matches() private method

private Matches ( XPathNavigator context, int key ) : bool
context XPathNavigator
key int
return bool
        internal bool Matches(XPathNavigator context, int key) {
            // We don't use XPathNavigator.Matches() to avoid cloning of Query on each call
            Query query = this.GetValueQuery(key, GetMatchesContext());

            try {
                bool result = query.MatchNode(context) != null;

                RecycleMatchesContext();
                return result;
            } catch(XPathException) {
                throw XsltException.Create(Res.Xslt_InvalidPattern, this.GetQueryExpression(key));
            }
        }

Usage Example

Beispiel #1
0
 internal bool PreserveWhiteSpace(Processor proc, XPathNavigator node)
 {
     // last one should win. I.E. We starting from the end. I.E. Lowest priority should go first
     if (_whitespaceList != null)
     {
         for (int i = _whitespaceList.Count - 1; 0 <= i; i--)
         {
             WhitespaceElement elem = (WhitespaceElement)_whitespaceList[i];
             if (proc.Matches(node, elem.Key))
             {
                 return(elem.PreserveSpace);
             }
         }
     }
     if (_imports != null)
     {
         for (int importIndex = _imports.Count - 1; importIndex >= 0; importIndex--)
         {
             Stylesheet stylesheet = (Stylesheet)_imports[importIndex];
             if (!stylesheet.PreserveWhiteSpace(proc, node))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
All Usage Examples Of System.Xml.Xsl.XsltOld.Processor::Matches