Пример #1
0
 public bool MatchNS(string target)
 {
     if (isAny)
     {
         return(true);
     }
     return(Nvdl.NSMatches(ns, 0, wildcard, target, 0, ""));
 }
Пример #2
0
 private void CheckCollision(ArrayList al, ref SimpleRule el, ref SimpleRule attr)
 {
     for (int i = 0; i < al.Count; i++)
     {
         SimpleRule r1 = (SimpleRule)al [i];
         if (r1.IsAny)
         {
             if (r1.MatchAttributes)
             {
                 attr = r1;
             }
             else
             {
                 el = r1;
             }
         }
         for (int j = i + 1; j < al.Count; j++)
         {
             SimpleRule r2 = (SimpleRule)al [j];
             if (r1.MatchAttributes != r2.MatchAttributes)
             {
                 continue;
             }
             if (r1.IsAny && r2.IsAny)
             {
                 throw new NvdlCompileException("collision in mode was found. Two anyNamespace elements.", this);
             }
             if (r1.IsAny || r2.IsAny)
             {
                 continue;
             }
             if (Nvdl.NSMatches(r1.NS, 0, r1.Wildcard,
                                r2.NS, 0, r2.Wildcard))
             {
                 throw new NvdlCompileException("collision in mode was found.", this);
             }
         }
     }
 }