Example #1
0
        public AttDef FindAttribute(string name)
        {
            if(AttList == null)
            {
                AttList = new AttList();
                AttList.Add(new AttDef(name));
            }

            return AttList[name.ToUpper()];
        }
Example #2
0
 void ParseAttList(AttList list, char term)
 {
     char ch = this.current.SkipWhitespace();
     while (ch != term)
     {
         if (ch == '%')
         {
             Entity e = ParseParameterEntity(SgmlDtd.peterm);
             PushEntity(this.current.ResolvedUri, e);
             ParseAttList(list, Entity.EOF);
             PopEntity();
             ch = this.current.SkipWhitespace();
         }
         else if (ch == '-')
         {
             ch = ParseDeclComments();
         }
         else
         {
             AttDef a = ParseAttDef(ch);
             list.Add(a);
         }
         ch = this.current.SkipWhitespace();
     }
 }
Example #3
0
 public void AddAttDefs(AttList list)
 {
     if (AttList == null)
     {
         AttList = list;
     }
     else
     {
         foreach (AttDef a in list)
         {
             if (AttList[a.Name] == null)
             {
                 AttList.Add(a);
             }
         }
     }
 }
Example #4
0
 void ParseAttList()
 {
     char ch = this.current.SkipWhitespace();
     string[] names = ParseNameGroup(ch, true);
     AttList attlist = new AttList();
     ParseAttList(attlist, '>');
     foreach (string name in names)
     {
         if (this.elements.ContainsKey(name))
         {
             ElementDecl e = this.elements[name];
             e.AddAttDefs(attlist);
         }
         else
         {
             this.current.Error("ATTLIST references undefined ELEMENT {0}", name);
         }
     }
 }