Example #1
0
        private NvdlAttach ReadAttach()
        {
            NvdlAttach el = new NvdlAttach();

            ReadCommonActionContent(el);
            return(el);
        }
Example #2
0
        internal void SimplifyPhase2(NvdlCompileContext ctx)
        {
            ArrayList al = new ArrayList();

            ConsumeIncludes(al, ctx);
            SimpleRule anyElement   = null;
            SimpleRule anyAttribute = null;

            // 6.4.12 + part of 6.4.13
            CheckCollision(al, ref anyElement, ref anyAttribute);
            // 6.4.13
            if (anyElement == null)
            {
                NvdlAnyNamespace ann = new NvdlAnyNamespace();
                ann.SourceUri    = this.SourceUri;
                ann.LineNumber   = this.LineNumber;
                ann.LinePosition = this.LinePosition;

                NvdlReject reject = new NvdlReject();
                reject.SourceUri    = this.SourceUri;
                reject.LineNumber   = this.LineNumber;
                reject.LinePosition = this.LinePosition;
                ann.Actions.Add(reject);
                ann.Match = NvdlRuleTarget.Elements;

                al.Add(new SimpleRule(ann, false, ctx));
            }
            if (anyAttribute == null)
            {
                NvdlAnyNamespace ann = new NvdlAnyNamespace();
                ann.SourceUri    = this.SourceUri;
                ann.LineNumber   = this.LineNumber;
                ann.LinePosition = this.LinePosition;

                NvdlAttach attach = new NvdlAttach();
                attach.SourceUri    = this.SourceUri;
                attach.LineNumber   = this.LineNumber;
                attach.LinePosition = this.LinePosition;
                ann.Match           = NvdlRuleTarget.Attributes;
                ann.Actions.Add(attach);

                al.Add(new SimpleRule(ann, true, ctx));
            }
            rules = (SimpleRule [])al.ToArray(typeof(SimpleRule));
        }
Example #3
0
		private NvdlAttach ReadAttach ()
		{
			NvdlAttach el = new NvdlAttach ();
			ReadCommonActionContent (el);
			return el;
		}
Example #4
0
		internal void SimplifyPhase2 (NvdlCompileContext ctx)
		{
			ArrayList al = new ArrayList ();
			ConsumeIncludes (al, ctx);
			SimpleRule anyElement = null;
			SimpleRule anyAttribute = null;
			// 6.4.12 + part of 6.4.13
			CheckCollision (al, ref anyElement, ref anyAttribute);
			// 6.4.13
			if (anyElement == null) {
				NvdlAnyNamespace ann = new NvdlAnyNamespace ();
				ann.SourceUri = this.SourceUri;
				ann.LineNumber = this.LineNumber;
				ann.LinePosition = this.LinePosition;

				NvdlReject reject = new NvdlReject ();
				reject.SourceUri = this.SourceUri;
				reject.LineNumber = this.LineNumber;
				reject.LinePosition = this.LinePosition;
				ann.Actions.Add (reject);
				ann.Match = NvdlRuleTarget.Elements;

				al.Add (new SimpleRule (ann, false, ctx));
			}
			if (anyAttribute == null) {
				NvdlAnyNamespace ann = new NvdlAnyNamespace ();
				ann.SourceUri = this.SourceUri;
				ann.LineNumber = this.LineNumber;
				ann.LinePosition = this.LinePosition;

				NvdlAttach attach = new NvdlAttach ();
				attach.SourceUri = this.SourceUri;
				attach.LineNumber = this.LineNumber;
				attach.LinePosition = this.LinePosition;
				ann.Match = NvdlRuleTarget.Attributes;
				ann.Actions.Add (attach);

				al.Add (new SimpleRule (ann, true, ctx));
			}
			rules = (SimpleRule []) al.ToArray (typeof (SimpleRule));
		}